diff options
-rw-r--r-- | drivers/nfc/pn544_hci.c | 8 | ||||
-rw-r--r-- | include/net/nfc/hci.h | 5 |
2 files changed, 11 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 | } |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 9b5ed2d94d60..e900072950cb 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -30,6 +30,11 @@ struct nfc_hci_ops { | |||
30 | int (*open) (struct nfc_hci_dev *hdev); | 30 | int (*open) (struct nfc_hci_dev *hdev); |
31 | void (*close) (struct nfc_hci_dev *hdev); | 31 | void (*close) (struct nfc_hci_dev *hdev); |
32 | int (*hci_ready) (struct nfc_hci_dev *hdev); | 32 | int (*hci_ready) (struct nfc_hci_dev *hdev); |
33 | /* | ||
34 | * xmit must always send the complete buffer before | ||
35 | * returning. Returned result must be 0 for success | ||
36 | * or negative for failure. | ||
37 | */ | ||
33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
34 | int (*start_poll) (struct nfc_hci_dev *hdev, | 39 | int (*start_poll) (struct nfc_hci_dev *hdev, |
35 | u32 im_protocols, u32 tm_protocols); | 40 | u32 im_protocols, u32 tm_protocols); |