@@ -311,7 +311,7 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
ctrl_reg = cdns_i2c_readreg(CDNS_I2C_CR_OFFSET);
ctrl_reg |= CDNS_I2C_CR_RW | CDNS_I2C_CR_CLR_FIFO;
- if ((id->p_msg->flags & I2C_M_RECV_LEN) == I2C_M_RECV_LEN)
+ if (id->p_msg->flags & I2C_M_RECV_LEN)
id->recv_count = I2C_SMBUS_BLOCK_MAX + 1;
/*
@@ -531,12 +531,13 @@ static int cdns_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
if (ret)
return ret;
- /* Report the other error interrupts to application as EIO */
- if (id->err_status & (CDNS_I2C_IXR_RX_UNF |
- CDNS_I2C_IXR_TX_OVF |
- CDNS_I2C_IXR_RX_OVF |
- CDNS_I2C_IXR_NACK)) {
+ /* Report the other error interrupts to application */
+ if (id->err_status) {
cdns_i2c_master_reset(adap);
+
+ if (id->err_status & CDNS_I2C_IXR_NACK)
+ return -ENXIO;
+
return -EIO;
}
}