Skip to content

Commit

Permalink
NFC: Ignore err when chip doesn't implement HW/SW info registers
Browse files Browse the repository at this point in the history
NFC_HCI_ID_MGMT_VERSION_SW and NFC_HCI_ID_MGMT_VERSION_HW are optional
registers for gate NFC_HCI_ID_MGMT_GATE in standard HCI. When chip
doesn't implement, just leave all the information as zeros.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Eric Lapuyade authored and Samuel Ortiz committed Nov 19, 2012
1 parent 07887e9 commit 23f7e6d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions net/nfc/hci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ static int nfc_hci_result_to_errno(u8 result)
switch (result) {
case NFC_HCI_ANY_OK:
return 0;
case NFC_HCI_ANY_E_REG_PAR_UNKNOWN:
return -EOPNOTSUPP;
case NFC_HCI_ANY_E_TIMEOUT:
return -ETIME;
default:
Expand Down Expand Up @@ -419,6 +421,10 @@ static int hci_dev_version(struct nfc_hci_dev *hdev)

r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE,
NFC_HCI_ID_MGMT_VERSION_SW, &skb);
if (r == -EOPNOTSUPP) {
pr_info("Software/Hardware info not available\n");
return 0;
}
if (r < 0)
return r;

Expand Down

0 comments on commit 23f7e6d

Please sign in to comment.