void mei_nfc_host_exit(struct mei_device *dev) { struct mei_nfc_dev *ndev; struct mei_cl *cl; struct mei_cl_device *cldev; cl = mei_cl_bus_find_cl_by_uuid(dev, mei_nfc_guid); if (!cl) return; cldev = cl->device; if (!cldev) return; ndev = (struct mei_nfc_dev *)cldev->priv_data; if (ndev) cancel_work_sync(&ndev->init_work); cldev->priv_data = NULL; mutex_lock(&dev->device_lock); /* Need to remove the device here * since mei_nfc_free will unlink the clients */ mei_cl_remove_device(cldev); mei_nfc_free(ndev); mutex_unlock(&dev->device_lock); }
void mei_nfc_host_exit(void) { struct mei_nfc_dev *ndev = &nfc_dev; if (ndev->cl && ndev->cl->device) mei_cl_remove_device(ndev->cl->device); mei_nfc_free(ndev); }