diff options
author | loos <loos@FreeBSD.org> | 2014-05-31 14:38:05 +0000 |
---|---|---|
committer | loos <loos@FreeBSD.org> | 2014-05-31 14:38:05 +0000 |
commit | 67af8e8a06fed45b7724a9a1544844eee6206d62 (patch) | |
tree | 65f709e08a8b824673f49fe4e67db127cffebe88 | |
parent | e4deb6b891826cd2159814f36c96c894d3906b7c (diff) | |
download | FreeBSD-src-67af8e8a06fed45b7724a9a1544844eee6206d62.zip FreeBSD-src-67af8e8a06fed45b7724a9a1544844eee6206d62.tar.gz |
Ignore IIC_ENOADDR from iicbus_reset() as it only means we have a
master-only controller.
This fixes the iic bus scan with i2c(8) (on supported controllers).
Tested with gpioiic(4).
-rw-r--r-- | sys/dev/iicbus/iic.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index 55084e9..16d113ee 100644 --- a/sys/dev/iicbus/iic.c +++ b/sys/dev/iicbus/iic.c @@ -322,6 +322,12 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t case I2CRSTCARD: error = iicbus_reset(parent, IIC_UNKNOWN, 0, NULL); + /* + * Ignore IIC_ENOADDR as it only means we have a master-only + * controller. + */ + if (error == IIC_ENOADDR) + error = 0; break; case I2CWRITE: |