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
This commit is contained in:
parent
12e0034dd0
commit
3469ab2117
@ -441,12 +441,11 @@ bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
|
||||
/* 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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user