From 34aa2211e75f765b204792d764ac2beb324ac3ec Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Sat, 31 May 2014 14:38:05 +0000 Subject: [PATCH] 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). --- sys/dev/iicbus/iic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index 55084e997b2..16d113ee6c7 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: