summaryrefslogtreecommitdiffstats
path: root/drivers/nfc/nxp-nci
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-11-04 11:13:00 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2015-11-18 02:30:49 +0100
commit59df9bb25cf8a13443b8335a7a9013817c050b88 (patch)
tree0a06192ae1da3cc488f44039a4ea8d7891c2449a /drivers/nfc/nxp-nci
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadlinux-59df9bb25cf8a13443b8335a7a9013817c050b88.tar.xz
linux-59df9bb25cf8a13443b8335a7a9013817c050b88.zip
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>
Diffstat (limited to 'drivers/nfc/nxp-nci')
-rw-r--r--drivers/nfc/nxp-nci/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index df4333c7ee0f..ec359fc10b48 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -85,7 +85,7 @@ static int nxp_nci_i2c_write(void *phy_id, struct sk_buff *skb)
return phy->hard_fault;
r = i2c_master_send(client, skb->data, skb->len);
- if (r == -EREMOTEIO) {
+ if (r < 0) {
/* Retry, chip was in standby */
usleep_range(110000, 120000);
r = i2c_master_send(client, skb->data, skb->len);