summaryrefslogtreecommitdiff
path: root/net/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-06-06 13:16:48 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2015-06-09 00:34:24 +0200
commit0e70cba71f8b61e0a0c7df526f5cee2d842ee93c (patch)
treef783d79b6b5098b964c7b4cb60cca8be229b2498 /net/nfc
parentdbd70b4046c8cdb7c8f5ffea9bdcae1a35e24df4 (diff)
downloadlwn-0e70cba71f8b61e0a0c7df526f5cee2d842ee93c.tar.gz
lwn-0e70cba71f8b61e0a0c7df526f5cee2d842ee93c.zip
NFC: nci: Move close ops call in nci_close_device
When closing the device some data (proprietary commands) might be sent. The core state machine needs to be set for correct command execution. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index b5dc15044466..edc10cc8e10b 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -440,6 +440,12 @@ static int nci_close_device(struct nci_dev *ndev)
set_bit(NCI_INIT, &ndev->flags);
__nci_request(ndev, nci_reset_req, 0,
msecs_to_jiffies(NCI_RESET_TIMEOUT));
+
+ /* After this point our queues are empty
+ * and no works are scheduled.
+ */
+ ndev->ops->close(ndev);
+
clear_bit(NCI_INIT, &ndev->flags);
del_timer_sync(&ndev->cmd_timer);
@@ -447,10 +453,6 @@ static int nci_close_device(struct nci_dev *ndev)
/* Flush cmd wq */
flush_workqueue(ndev->cmd_wq);
- /* After this point our queues are empty
- * and no works are scheduled. */
- ndev->ops->close(ndev);
-
/* Clear flags */
ndev->flags = 0;