Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e70cba7 authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz
Browse files

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: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent dbd70b40
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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;