diff options
author | 2017-02-22 21:41:31 +0000 | |
---|---|---|
committer | 2017-02-22 21:41:31 +0000 | |
commit | cbf409265a39bd816bc412a59e29114ffcedb4e0 (patch) | |
tree | 6e57c2d959779b8abf3536a4f3095c29732fdb3a /sys | |
parent | sync (diff) | |
download | wireguard-openbsd-cbf409265a39bd816bc412a59e29114ffcedb4e0.tar.xz wireguard-openbsd-cbf409265a39bd816bc412a59e29114ffcedb4e0.zip |
fix timeout loop
from Anton Lindqvist
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpisbs.c | 10 |
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]; |