Thread (1 message) 1 message, 1 author, 2015-06-06

[RFC v2 10/17] nfc: st21nfcb: Fix st21nfcb_nci_close

From: Christophe Ricard <hidden>
Date: 2015-06-06 11:16:46
Subsystem: nfc subsystem, the rest · Maintainers: David Heidelberg, Linus Torvalds

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 <redacted>
---
 drivers/nfc/st21nfcb/st21nfcb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/nfc/st21nfcb/st21nfcb.c b/drivers/nfc/st21nfcb/st21nfcb.c
index 7a51bf0..12699fa 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;
 }
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help