Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315284
b: refs/heads/master
c: ccca0d6
h: refs/heads/master
v: v3
  • Loading branch information
Eric Lapuyade authored and John W. Linville committed Jul 9, 2012
1 parent 5ad17e9 commit af6d7ab
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 456411ca812860d7ba06d3e4013ce1d8b9dbc7cd
refs/heads/master: ccca0d6e8805f12fcda2e740c44afa7191923559
27 changes: 16 additions & 11 deletions trunk/net/nfc/hci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,13 @@ static void nfc_hci_msg_rx_work(struct work_struct *work)
}
}

void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result,
struct sk_buff *skb)
static void __nfc_hci_cmd_completion(struct nfc_hci_dev *hdev, int err,
struct sk_buff *skb)
{
mutex_lock(&hdev->msg_tx_mutex);

if (hdev->cmd_pending_msg == NULL) {
kfree_skb(skb);
goto exit;
}

del_timer_sync(&hdev->cmd_timer);

if (hdev->cmd_pending_msg->cb)
hdev->cmd_pending_msg->cb(hdev, nfc_hci_result_to_errno(result),
skb,
hdev->cmd_pending_msg->cb(hdev, err, skb,
hdev->cmd_pending_msg->cb_context);
else
kfree_skb(skb);
Expand All @@ -150,6 +142,19 @@ void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result,
hdev->cmd_pending_msg = NULL;

queue_work(hdev->msg_tx_wq, &hdev->msg_tx_work);
}

void nfc_hci_resp_received(struct nfc_hci_dev *hdev, u8 result,
struct sk_buff *skb)
{
mutex_lock(&hdev->msg_tx_mutex);

if (hdev->cmd_pending_msg == NULL) {
kfree_skb(skb);
goto exit;
}

__nfc_hci_cmd_completion(hdev, nfc_hci_result_to_errno(result), skb);

exit:
mutex_unlock(&hdev->msg_tx_mutex);
Expand Down

0 comments on commit af6d7ab

Please sign in to comment.