NFC: Fixed nfc core and hci unregistration and cleanup

When an adapter is removed, it will unregister itself from hci and/or
nfc core. In order to do that safely, work tasks must first be canceled
and prevented to be scheduled again, before the hci or nfc device can be
destroyed.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Eric Lapuyade
2012-11-26 18:06:27 +01:00
committed by Samuel Ortiz
parent 5f4d6214ef
commit f0c9103813
5 changed files with 58 additions and 33 deletions

View File

@@ -87,6 +87,8 @@ struct nfc_hci_dev {
u32 max_data_link_payload;
bool shutting_down;
struct mutex msg_tx_mutex;
struct list_head msg_tx_queue;

View File

@@ -115,6 +115,8 @@ struct nfc_dev {
struct timer_list check_pres_timer;
struct work_struct check_pres_work;
bool shutting_down;
struct nfc_ops *ops;
};
#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev)