aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>2012-09-20 02:59:10 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-24 18:17:27 -0400
commit96e324024b421b3753eb142d5d92fbe4ac5e7519 (patch)
treec05ff22fb3bda8511ec18ffc997c31e074e1d0c3 /drivers/nfc
parent5adf54de97270256f6ec0e368ddde68ac516b692 (diff)
NFC: xmit from hci ops must return 0 or negative
xmit callback provided by a driver encapsulates upper layers data and sends it to the hardware. So, HCI does not know the exact amount of data being sent and thus can't handle partially sent frames properly. Therefore, the driver must return 0 for completely sent frame or negative for failure. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Acked-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-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)
235 r = i2c_master_send(client, buf, len); 235 r = i2c_master_send(client, buf, len);
236 } 236 }
237 237
238 if (r >= 0 && r != len) 238 if (r >= 0) {
239 r = -EREMOTEIO; 239 if (r != len)
240 return -EREMOTEIO;
241 else
242 return 0;
243 }
240 244
241 return r; 245 return r;
242} 246}