summaryrefslogtreecommitdiff
path: root/drivers/nfc/pn544_hci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nfc/pn544_hci.c')
-rw-r--r--drivers/nfc/pn544_hci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/nfc/pn544_hci.c b/drivers/nfc/pn544_hci.c
index 7b0c2176e89b..c9c8570273ab 100644
--- a/drivers/nfc/pn544_hci.c
+++ b/drivers/nfc/pn544_hci.c
@@ -235,8 +235,12 @@ static int pn544_hci_i2c_write(struct i2c_client *client, u8 *buf, int len)
r = i2c_master_send(client, buf, len);
}
- if (r >= 0 && r != len)
- r = -EREMOTEIO;
+ if (r >= 0) {
+ if (r != len)
+ return -EREMOTEIO;
+ else
+ return 0;
+ }
return r;
}