summaryrefslogtreecommitdiffstats
path: root/net/nfc/hci/shdlc.c
diff options
context:
space:
mode:
authorEric Lapuyade <eric.lapuyade@linux.intel.com>2012-09-11 10:43:50 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-09-25 00:17:25 +0200
commitf3e8fb552789f4845e60b11c47b676d14b9488e5 (patch)
tree8fde55db141d361952cbb190d9e59231e143157b /net/nfc/hci/shdlc.c
parente4c4789e55327e5f2bd6cafcccd46f9b6251bbc3 (diff)
downloadop-kernel-dev-f3e8fb552789f4845e60b11c47b676d14b9488e5.zip
op-kernel-dev-f3e8fb552789f4845e60b11c47b676d14b9488e5.tar.gz
NFC: Modified hci_transceive to become an asynchronous operation
This enables the completion callback to be called from a different context, preventing a possible deadlock if the callback resulted in the invocation of a nested call to the currently locked nfc_dev. This is also more in line with the im_transceive nfc_ops for NFC Core or NCI drivers which already behave asynchronously. Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc/hci/shdlc.c')
-rw-r--r--net/nfc/hci/shdlc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c
index 9357ba7..c63af7d 100644
--- a/net/nfc/hci/shdlc.c
+++ b/net/nfc/hci/shdlc.c
@@ -777,12 +777,13 @@ static int nfc_shdlc_complete_target_discovered(struct nfc_hci_dev *hdev,
static int nfc_shdlc_data_exchange(struct nfc_hci_dev *hdev,
struct nfc_target *target,
struct sk_buff *skb,
- struct sk_buff **res_skb)
+ data_exchange_cb_t cb, void *cb_context)
{
struct nfc_shdlc *shdlc = nfc_hci_get_clientdata(hdev);
if (shdlc->ops->data_exchange)
- return shdlc->ops->data_exchange(shdlc, target, skb, res_skb);
+ return shdlc->ops->data_exchange(shdlc, target, skb, cb,
+ cb_context);
return -EPERM;
}
OpenPOWER on IntegriCloud