mei: remove flash_work_queue
[firefly-linux-kernel-4.4.55.git] / drivers / misc / mei / nfc.c
index 994ca4aff1a37ecf1b6fc53a2b44e1f446b710dd..0a892205ce7e6314fa53f8b9046f8a6d7e57206a 100644 (file)
@@ -547,12 +547,16 @@ err:
        return ret;
 }
 
-void mei_nfc_host_exit(void)
+void mei_nfc_host_exit(struct mei_device *dev)
 {
        struct mei_nfc_dev *ndev = &nfc_dev;
 
+       cancel_work_sync(&ndev->init_work);
+
+       mutex_lock(&dev->device_lock);
        if (ndev->cl && ndev->cl->device)
                mei_cl_remove_device(ndev->cl->device);
 
        mei_nfc_free(ndev);
+       mutex_unlock(&dev->device_lock);
 }