diff options
| author | Ian Lepore <ian@FreeBSD.org> | 2015-10-09 21:34:46 +0000 |
|---|---|---|
| committer | Ian Lepore <ian@FreeBSD.org> | 2015-10-09 21:34:46 +0000 |
| commit | 848a03492240f2137da5ad6243452e965703637e (patch) | |
| tree | 52e66b9bdf91d6d08caec77d71d6fd86c1077f3e /sys/dev/iicbus/iiconf.c | |
| parent | 6f279052a29723c0c80a73caab9a28c6ca8fe266 (diff) | |
Notes
Diffstat (limited to 'sys/dev/iicbus/iiconf.c')
| -rw-r--r-- | sys/dev/iicbus/iiconf.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c index 09edb39ffd6c..37de02052391 100644 --- a/sys/dev/iicbus/iiconf.c +++ b/sys/dev/iicbus/iiconf.c @@ -397,8 +397,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) else error = iicbus_start(bus, addr, 0); } - - if (error) + if (error != 0) break; if (msgs[i].flags & IIC_M_RD) @@ -407,6 +406,8 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) else error = iicbus_write(bus, msgs[i].buf, msgs[i].len, &lenwrote, 0); + if (error != 0) + break; if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || (nostop && i + 1 < nmsgs)) { @@ -416,5 +417,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) iicbus_stop(bus); } } + if (error != 0 && !nostop) + iicbus_stop(bus); return (error); } |
