aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@linux.intel.com>2012-10-17 10:48:21 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-11-19 17:56:58 -0500
commit23f7e6d0d060e2eb0be1daef818d030025453b44 (patch)
tree6272fc7af32be8c116e15e10c1c185994bce0dc8
parent07887e92205c5808820de0be53bf326b4019d060 (diff)
NFC: Ignore err when chip doesn't implement HW/SW info registers
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>
-rw-r--r--net/nfc/hci/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index bc571b0efb92..a58db89b4555 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -38,6 +38,8 @@ static int nfc_hci_result_to_errno(u8 result)
38 switch (result) { 38 switch (result) {
39 case NFC_HCI_ANY_OK: 39 case NFC_HCI_ANY_OK:
40 return 0; 40 return 0;
41 case NFC_HCI_ANY_E_REG_PAR_UNKNOWN:
42 return -EOPNOTSUPP;
41 case NFC_HCI_ANY_E_TIMEOUT: 43 case NFC_HCI_ANY_E_TIMEOUT:
42 return -ETIME; 44 return -ETIME;
43 default: 45 default:
@@ -419,6 +421,10 @@ static int hci_dev_version(struct nfc_hci_dev *hdev)
419 421
420 r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE, 422 r = nfc_hci_get_param(hdev, NFC_HCI_ID_MGMT_GATE,
421 NFC_HCI_ID_MGMT_VERSION_SW, &skb); 423 NFC_HCI_ID_MGMT_VERSION_SW, &skb);
424 if (r == -EOPNOTSUPP) {
425 pr_info("Software/Hardware info not available\n");
426 return 0;
427 }
422 if (r < 0) 428 if (r < 0)
423 return r; 429 return r;
424 430