summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-03 23:24:07 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-01-03 23:24:07 +0000
commit7801326d53b129d85a89eaa30826651192ab4a0a (patch)
treec8b37b9d98da70baf48abd4eac3c4ad894de9682 /sys/dev/pci
parent5c8a42afadc988c6eb549ec4826d92f7db1ab41d (diff)
Revert part of the previous committed by mistake.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/piixpm.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index afb8835f4cf..44ad8e4d843 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixpm.c,v 1.10 2006/01/03 22:39:03 grange Exp $ */
+/* $OpenBSD: piixpm.c,v 1.11 2006/01/03 23:24:06 grange Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -199,8 +199,8 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
{
struct piixpm_softc *sc = cookie;
u_int8_t *b;
- u_int8_t ctl, st, sctl;
- int retries, error = 0;
+ u_int8_t ctl, st;
+ int retries;
DPRINTF(("%s: exec op %d, addr 0x%x, cmdlen %d, len %d, "
"flags 0x%x, status 0x%b\n", sc->sc_dev.dv_xname, op, addr,
@@ -220,11 +220,6 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
sc->sc_i2c_xfer.flags = flags;
sc->sc_i2c_xfer.error = 0;
- /* Make sure SMBALERT# assertion disabled */
- sctl = bus_space_read_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_SC);
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_SC,
- sctl & ~PIIX_SMB_SC_ALERTEN);
-
/* Set slave address and transfer direction */
bus_space_write_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_TXSLVA,
PIIX_SMB_TXSLVA_ADDR(addr) |
@@ -274,20 +269,16 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
if (st & PIIX_SMB_HS_BUSY) {
printf("%s: timeout, status 0x%b\n",
sc->sc_dev.dv_xname, st, PIIX_SMB_HS_BITS);
- error = 1;
- } else {
- piixpm_intr(sc);
+ return (1);
}
+ piixpm_intr(sc);
} else {
/* Wait for interrupt */
if (tsleep(sc, PRIBIO, "iicexec", PIIXPM_TIMEOUT * hz))
- error = 1;
+ return (1);
}
- /* Restore SMBALERT# assertion */
- bus_space_write_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_SC, sctl);
-
- if (error || sc->sc_i2c_xfer.error)
+ if (sc->sc_i2c_xfer.error)
return (1);
return (0);