void mei_stop(struct mei_device *dev) { dev_dbg(&dev->pdev->dev, "stopping the device.\n"); mei_cancel_work(dev); mei_nfc_host_exit(dev); mei_cl_bus_remove_devices(dev); mutex_lock(&dev->device_lock); mei_wd_stop(dev); dev->dev_state = MEI_DEV_POWER_DOWN; mei_reset(dev); mutex_unlock(&dev->device_lock); mei_watchdog_unregister(dev); }
void mei_stop(struct mei_device *dev) { dev_dbg(dev->dev, "stopping the device.\n"); mutex_lock(&dev->device_lock); dev->dev_state = MEI_DEV_POWER_DOWN; mutex_unlock(&dev->device_lock); mei_cl_bus_remove_devices(dev); mei_cancel_work(dev); mei_clear_interrupts(dev); mei_synchronize_irq(dev); mutex_lock(&dev->device_lock); mei_reset(dev); /* move device to disabled state unconditionally */ dev->dev_state = MEI_DEV_DISABLED; mutex_unlock(&dev->device_lock); }