mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
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>
This commit is contained in:
committed by
Samuel Ortiz
parent
5adf54de97
commit
96e324024b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user