aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-06-06 13:16:46 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2015-06-09 00:34:23 +0200
commitcc1417eb24f154ed7a7cd8aa7018b80fa120b732 (patch)
treefeb2acf89ab32bc8b08533193636f8f27a498d47 /drivers/nfc
parentNFC: st21nfcb: Add ndlc_close in st21nfcb_nci_remove (diff)
downloadlinux-dev-cc1417eb24f154ed7a7cd8aa7018b80fa120b732.tar.xz
linux-dev-cc1417eb24f154ed7a7cd8aa7018b80fa120b732.zip
NFC: st21nfcb: Fix st21nfcb_nci_close
When closing st21nfcb driver, flag ST21NFCB_NCI_RUNNING can be cleared only once the ndlc and the transport (i2c or spi) layers are released. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/st21nfcb/st21nfcb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/nfc/st21nfcb/st21nfcb.c b/drivers/nfc/st21nfcb/st21nfcb.c
index 7a51bf056a69..12699fa0b1b9 100644
--- a/drivers/nfc/st21nfcb/st21nfcb.c
+++ b/drivers/nfc/st21nfcb/st21nfcb.c
@@ -47,11 +47,13 @@ static int st21nfcb_nci_close(struct nci_dev *ndev)
{
struct st21nfcb_nci_info *info = nci_get_drvdata(ndev);
- if (!test_and_clear_bit(ST21NFCB_NCI_RUNNING, &info->flags))
+ if (!test_bit(ST21NFCB_NCI_RUNNING, &info->flags))
return 0;
ndlc_close(info->ndlc);
+ clear_bit(ST21NFCB_NCI_RUNNING, &info->flags);
+
return 0;
}