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>
{
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;
}