Skip to content

Commit 59df9bb

Browse files
Fabio EstevamSamuel Ortiz
authored andcommitted
nxp-nci: i2c: Do not check specifically for -EREMOTEIO error
Function nxp_nci_i2c_write currently assumes in case of I2C bus NACK that the NFC device is in stand-by mode and will retry the I2C transaction after a pause. This assumes that the first failed I2C transaction will wake-up the device. This is done by checking on EREMOTEIO, which is wrong. According to Documentation/i2c/fault-codes ENXIO shall be used. Unfortunately the NOACK return code is currently inconsistent across various I2C host controller drivers. So only check for the generic error case instead. This is a temporary fix. As soon as all I2C bus master drivers are fixed to consistently return 'ENXIO', then we can do the specific error check again. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 7f151f1 commit 59df9bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nfc/nxp-nci/i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int nxp_nci_i2c_write(void *phy_id, struct sk_buff *skb)
8585
return phy->hard_fault;
8686

8787
r = i2c_master_send(client, skb->data, skb->len);
88-
if (r == -EREMOTEIO) {
88+
if (r < 0) {
8989
/* Retry, chip was in standby */
9090
usleep_range(110000, 120000);
9191
r = i2c_master_send(client, skb->data, skb->len);

0 commit comments

Comments
 (0)