summaryrefslogtreecommitdiffstats
path: root/net/nfc/hci/command.c
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@intel.com>2012-05-03 15:35:25 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-07-09 16:42:07 -0400
commit6c1c5b9e1d8a25268a607c762576b5c16e3e7230 (patch)
tree83508c5809fed818875d51edf8db083a111b6ec2 /net/nfc/hci/command.c
parent72b06f75fea45fa861f2e137bc94e56aab306c4b (diff)
downloadblackbird-op-linux-6c1c5b9e1d8a25268a607c762576b5c16e3e7230.tar.gz
blackbird-op-linux-6c1c5b9e1d8a25268a607c762576b5c16e3e7230.zip
NFC: Changed HCI cmd execution completion result to std linux errno
An HCI command can complete either from an HCI response (with an HCI result) or as a consequence of any other system error during processing. The completion therefore needs to take a standard errno code. The HCI response will convert its result to a standard errno before calling the completion. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/hci/command.c')
-rw-r--r--net/nfc/hci/command.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/net/nfc/hci/command.c b/net/nfc/hci/command.c
index 8729abf5f18b..12cd6f3f77ec 100644
--- a/net/nfc/hci/command.c
+++ b/net/nfc/hci/command.c
@@ -28,26 +28,14 @@
#include "hci.h"
-static int nfc_hci_result_to_errno(u8 result)
-{
- switch (result) {
- case NFC_HCI_ANY_OK:
- return 0;
- case NFC_HCI_ANY_E_TIMEOUT:
- return -ETIMEDOUT;
- default:
- return -1;
- }
-}
-
-static void nfc_hci_execute_cb(struct nfc_hci_dev *hdev, u8 result,
+static void nfc_hci_execute_cb(struct nfc_hci_dev *hdev, int err,
struct sk_buff *skb, void *cb_data)
{
struct hcp_exec_waiter *hcp_ew = (struct hcp_exec_waiter *)cb_data;
- pr_debug("HCI Cmd completed with HCI result=%d\n", result);
+ pr_debug("HCI Cmd completed with result=%d\n", err);
- hcp_ew->exec_result = nfc_hci_result_to_errno(result);
+ hcp_ew->exec_result = err;
if (hcp_ew->exec_result == 0)
hcp_ew->result_skb = skb;
else
OpenPOWER on IntegriCloud