svn commit: r273337 - head/sys/arm/broadcom/bcm2835

Luiz Otavio O Souza loos at FreeBSD.org
Mon Oct 20 18:04:21 UTC 2014


Author: loos
Date: Mon Oct 20 18:04:20 2014
New Revision: 273337
URL: https://svnweb.freebsd.org/changeset/base/273337

Log:
  Fix the mtx_sleep() error checking, catch all errors and not only
  EWOULDBLOCK.
  
  Do not print any message at errors.  The errors are properly sent to upper
  layers which should be able to deal with it, including printing the errors
  when they need to.
  
  The error message was quite annoying while scanning the i2c bus.
  
  MFC after:	1 week

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c	Mon Oct 20 18:00:50 2014	(r273336)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c	Mon Oct 20 18:04:20 2014	(r273337)
@@ -441,12 +441,11 @@ bcm_bsc_transfer(device_t dev, struct ii
 		/* Wait for the transaction to complete. */
 		err = mtx_sleep(dev, &sc->sc_mtx, 0, "bsciow", hz);
 
-		/* Check if we have a timeout or an I2C error. */
-		if ((sc->sc_flags & BCM_I2C_ERROR) || err == EWOULDBLOCK) {
-			device_printf(sc->sc_dev, "I2C error\n");
+		/* Check for errors. */
+		if (err != 0 && (sc->sc_flags & BCM_I2C_ERROR))
 			err = EIO;
+		if (err != 0)
 			break;
-		}
 	}
 
 	/* Clean the controller flags. */


More information about the svn-src-head mailing list