Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc1417eb authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz
Browse files

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: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 6628b09f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
}