diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c index 03223feab7..0c1547c4e9 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_i2c.c @@ -242,7 +242,9 @@ static int lpc17_40_i2c_start(struct lpc17_40_i2cdev_s *priv) lpc17_40_i2c_timeout, (wdparm_t)priv); nxsem_wait(&priv->wait); - return priv->nmsg; + /* Remaining messages should be zero or an error occurred */ + + return priv->nmsg ? -ENXIO : OK; } /****************************************************************************