diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2005-12-25 14:54:46 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2005-12-25 14:54:46 +0000 |
commit | daae8e454db792e2afc531c80320d6a6f140dffd (patch) | |
tree | c4d3d55f66f34bf95fb517ae7b98b855b67f50ae | |
parent | adb2a1e215699b35b9d68788b718ac7eb5e7aa94 (diff) |
Do not make the whole sc_i2c_xfer structure volatile, only the
error field which is modified by the interrupt handler.
-rw-r--r-- | sys/dev/pci/ichiic.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/pci/ichiic.c b/sys/dev/pci/ichiic.c index a5421aa8814..015c46ed77e 100644 --- a/sys/dev/pci/ichiic.c +++ b/sys/dev/pci/ichiic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ichiic.c,v 1.2 2005/12/20 05:42:32 grange Exp $ */ +/* $OpenBSD: ichiic.c,v 1.3 2005/12/25 14:54:45 grange Exp $ */ /* * Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org> @@ -55,12 +55,12 @@ struct ichiic_softc { struct i2c_controller sc_i2c_tag; struct lock sc_i2c_lock; - volatile struct { - i2c_op_t op; - void * buf; - size_t len; - int flags; - int error; + struct { + i2c_op_t op; + void * buf; + size_t len; + int flags; + volatile int error; } sc_i2c_xfer; }; @@ -257,6 +257,7 @@ ichiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, } ichiic_intr(sc); } else { + /* Wait for interrupt */ if (tsleep(sc, PRIBIO, "iicexec", ICHIIC_TIMEOUT * hz)) return (1); } |