diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-06-06 07:16:48 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-06-08 18:34:24 -0400 |
commit | 0e70cba71f8b61e0a0c7df526f5cee2d842ee93c (patch) | |
tree | f783d79b6b5098b964c7b4cb60cca8be229b2498 /net/nfc | |
parent | dbd70b4046c8cdb7c8f5ffea9bdcae1a35e24df4 (diff) |
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.c | 10 |
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) | |||
440 | set_bit(NCI_INIT, &ndev->flags); | 440 | set_bit(NCI_INIT, &ndev->flags); |
441 | __nci_request(ndev, nci_reset_req, 0, | 441 | __nci_request(ndev, nci_reset_req, 0, |
442 | msecs_to_jiffies(NCI_RESET_TIMEOUT)); | 442 | msecs_to_jiffies(NCI_RESET_TIMEOUT)); |
443 | |||
444 | /* After this point our queues are empty | ||
445 | * and no works are scheduled. | ||
446 | */ | ||
447 | ndev->ops->close(ndev); | ||
448 | |||
443 | clear_bit(NCI_INIT, &ndev->flags); | 449 | clear_bit(NCI_INIT, &ndev->flags); |
444 | 450 | ||
445 | del_timer_sync(&ndev->cmd_timer); | 451 | del_timer_sync(&ndev->cmd_timer); |
@@ -447,10 +453,6 @@ static int nci_close_device(struct nci_dev *ndev) | |||
447 | /* Flush cmd wq */ | 453 | /* Flush cmd wq */ |
448 | flush_workqueue(ndev->cmd_wq); | 454 | flush_workqueue(ndev->cmd_wq); |
449 | 455 | ||
450 | /* After this point our queues are empty | ||
451 | * and no works are scheduled. */ | ||
452 | ndev->ops->close(ndev); | ||
453 | |||
454 | /* Clear flags */ | 456 | /* Clear flags */ |
455 | ndev->flags = 0; | 457 | ndev->flags = 0; |
456 | 458 | ||