summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2017-02-22 21:41:32 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2017-02-22 21:41:32 +0000
commit12055c650fe9308abb9c986260669a2d6fda5baa (patch)
tree041c7b4b97b9833830b247a0941083cfa8841c82 /sys/dev
parente7cfbd4d528a3eacee4ef9c21e597de2930b48e7 (diff)
fix timeout loop
from Anton Lindqvist
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpisbs.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/acpi/acpisbs.c b/sys/dev/acpi/acpisbs.c
index fddb6b7aa34..fbb16a14e39 100644
--- a/sys/dev/acpi/acpisbs.c
+++ b/sys/dev/acpi/acpisbs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpisbs.c,v 1.1 2017/02/22 16:39:56 jcs Exp $ */
+/* $OpenBSD: acpisbs.c,v 1.2 2017/02/22 21:41:31 jcs Exp $ */
/*
* Smart Battery Subsystem device driver
* ACPI 5.0 spec section 10
@@ -377,7 +377,7 @@ acpi_smbus_read(struct acpisbs_softc *sc, uint8_t type, uint8_t cmd, int len,
acpiec_write(sc->sc_ec, sc->sc_ec_base + SMBUS_CMD, 1, &cmd);
acpiec_write(sc->sc_ec, sc->sc_ec_base + SMBUS_PRTCL, 1, &type);
- for (j = SMBUS_TIMEOUT; j < 0; j--) {
+ for (j = SMBUS_TIMEOUT; j > 0; j--) {
acpiec_read(sc->sc_ec, sc->sc_ec_base + SMBUS_PRTCL, 1, &val);
if (val == 0)
break;
@@ -388,9 +388,6 @@ acpi_smbus_read(struct acpisbs_softc *sc, uint8_t type, uint8_t cmd, int len,
return 1;
}
- if (cold)
- DELAY(1000);
-
acpiec_read(sc->sc_ec, sc->sc_ec_base + SMBUS_STS, 1, &val);
if (val & SMBUS_STS_MASK) {
printf("%s: %s: error reading status: 0x%x\n",
@@ -398,9 +395,6 @@ acpi_smbus_read(struct acpisbs_softc *sc, uint8_t type, uint8_t cmd, int len,
return 1;
}
- if (cold)
- DELAY(1000);
-
switch (type) {
case SMBUS_READ_WORD: {
uint8_t word[2];