Browse Source

NFC: st21nfcb: Add ndlc_close in st21nfcb_nci_remove

In order to release the st21nfcb properly close the ndlc
layer first.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Christophe Ricard 10 years ago
parent
commit
6628b09f03
1 changed files with 4 additions and 0 deletions
  1. 4 0
      drivers/nfc/st21nfcb/st21nfcb.c

+ 4 - 0
drivers/nfc/st21nfcb/st21nfcb.c

@@ -131,6 +131,10 @@ EXPORT_SYMBOL_GPL(st21nfcb_nci_probe);
 
 
 void st21nfcb_nci_remove(struct nci_dev *ndev)
 void st21nfcb_nci_remove(struct nci_dev *ndev)
 {
 {
+	struct st21nfcb_nci_info *info = nci_get_drvdata(ndev);
+
+	ndlc_close(info->ndlc);
+
 	nci_unregister_device(ndev);
 	nci_unregister_device(ndev);
 	nci_free_device(ndev);
 	nci_free_device(ndev);
 }
 }