svn commit: r266923 - head/sys/dev/iicbus

Luiz Otavio O Souza loos at FreeBSD.org
Sat May 31 14:38:06 UTC 2014


Author: loos
Date: Sat May 31 14:38:05 2014
New Revision: 266923
URL: http://svnweb.freebsd.org/changeset/base/266923

Log:
  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).

Modified:
  head/sys/dev/iicbus/iic.c

Modified: head/sys/dev/iicbus/iic.c
==============================================================================
--- head/sys/dev/iicbus/iic.c	Sat May 31 14:27:50 2014	(r266922)
+++ head/sys/dev/iicbus/iic.c	Sat May 31 14:38:05 2014	(r266923)
@@ -322,6 +322,12 @@ iicioctl(struct cdev *dev, u_long cmd, c
 
 	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:


More information about the svn-src-all mailing list