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. */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to