Fix the error checking, broken on r273337, to _not_ ignore controller

errors.

Without this fix you can't even scan the bus (all operations will always
succeed).

MFC with:	r273337
Pointy hat to:	loos
This commit is contained in:
Luiz Otavio O Souza 2014-11-12 03:07:46 +00:00
parent 6eef1a334d
commit 0a39cc71f8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274415

View File

@ -441,7 +441,7 @@ bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
err = mtx_sleep(dev, &sc->sc_mtx, 0, "bsciow", hz);
/* Check for errors. */
if (err != 0 && (sc->sc_flags & BCM_I2C_ERROR))
if (err == 0 && (sc->sc_flags & BCM_I2C_ERROR))
err = EIO;
if (err != 0)
break;