From: Christophe Ricard Date: Sat, 6 Jun 2015 11:16:46 +0000 (+0200) Subject: NFC: st21nfcb: Fix st21nfcb_nci_close X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cc1417eb24f154ed7a7cd8aa7018b80fa120b732;p=linux-beck.git 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 Signed-off-by: Samuel Ortiz --- 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; }