diff options
| author | Andriy Gapon <avg@FreeBSD.org> | 2019-05-29 09:08:20 +0000 |
|---|---|---|
| committer | Andriy Gapon <avg@FreeBSD.org> | 2019-05-29 09:08:20 +0000 |
| commit | fec2f12ebdc35b3703360c1f99783f4d331e3d0a (patch) | |
| tree | 2cbabb41c3ffca7b4a37379d3caeff82d5783bd8 /sys/dev/iicbus/iiconf.c | |
| parent | 93a2d4c92f7b8008041cc5d6cf3052e7a6c106ff (diff) | |
Notes
Diffstat (limited to 'sys/dev/iicbus/iiconf.c')
| -rw-r--r-- | sys/dev/iicbus/iiconf.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/iicbus/iiconf.c b/sys/dev/iicbus/iiconf.c index 916baf2dba0c..94ce3d18c70f 100644 --- a/sys/dev/iicbus/iiconf.c +++ b/sys/dev/iicbus/iiconf.c @@ -427,7 +427,7 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) { int i, error, lenread, lenwrote, nkid, rpstart, addr; device_t *children, bus; - bool nostop, started; + bool started; if ((error = device_get_children(dev, &children, &nkid)) != 0) return (IIC_ERESOURCE); @@ -438,7 +438,6 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) bus = children[0]; rpstart = 0; free(children, M_TEMP); - nostop = iicbus_get_nostop(dev); started = false; for (i = 0, error = 0; i < nmsgs && error == 0; i++) { addr = msgs[i].slave; @@ -466,12 +465,11 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) if (error != 0) break; - if ((msgs[i].flags & IIC_M_NOSTOP) != 0 || - (nostop && i + 1 < nmsgs)) { - rpstart = 1; /* Next message gets repeated start */ - } else { + if (!(msgs[i].flags & IIC_M_NOSTOP)) { rpstart = 0; iicbus_stop(bus); + } else { + rpstart = 1; /* Next message gets repeated start */ } } if (error != 0 && started) |
