NFC: nci: Move close ops call in nci_close_device
authorChristophe Ricard <christophe.ricard@gmail.com>
Sat, 6 Jun 2015 11:16:48 +0000 (13:16 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Jun 2015 22:34:24 +0000 (00:34 +0200)
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>
net/nfc/nci/core.c

index b5dc15044466388d61d3c3d9d173447ec501d7a4..edc10cc8e10b94881f82e3dab1c3c7d9741ceef1 100644 (file)
@@ -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;
 
This page took 0.024997 seconds and 5 git commands to generate.