Page MenuHomeFreeBSD

D47221.diff
No OneTemporary

D47221.diff

diff --git a/sys/dev/iicbus/controller/vybrid/vf_i2c.c b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
--- a/sys/dev/iicbus/controller/vybrid/vf_i2c.c
+++ b/sys/dev/iicbus/controller/vybrid/vf_i2c.c
@@ -207,13 +207,6 @@
sc = device_get_softc(dev);
vf_i2c_dbg(sc, "i2c detach\n");
- mtx_lock(&sc->mutex);
-
- if (sc->freq == 0) {
- vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n");
- WRITE1(sc, I2C_IBFD, 0x00);
- }
-
error = bus_generic_detach(dev);
if (error != 0) {
device_printf(dev, "cannot detach child devices.\n");
@@ -226,6 +219,13 @@
return (error);
}
+ mtx_lock(&sc->mutex);
+
+ if (sc->freq == 0) {
+ vf_i2c_dbg(sc, "Writing 0x00 to clock divider register\n");
+ WRITE1(sc, I2C_IBFD, 0x00);
+ }
+
bus_release_resources(dev, i2c_spec, sc->res);
mtx_unlock(&sc->mutex);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 2:52 AM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14303708
Default Alt Text
D47221.diff (816 B)

Event Timeline