mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = true;
- if (drv->remove)
- drv->remove(dev);
+ drv->remove(dev);
mutex_unlock(&dev->visordriver_callback_lock);
dev_stop_periodic_work(dev);
dev = to_visor_device(xdev);
drv = to_visor_driver(xdev->driver);
- if (!drv->probe)
- return -ENODEV;
mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = false;
if (!initialized)
return -ENODEV;
+ if (!drv->probe)
+ return -ENODEV;
+
+ if (!drv->remove)
+ return -ENODEV;
+
+ if (!drv->pause)
+ return -ENODEV;
+
+ if (!drv->resume)
+ return -ENODEV;
+
drv->driver.name = drv->name;
drv->driver.bus = &visorbus_type;
drv->driver.probe = visordriver_probe_device;
return -EBUSY;
if (is_pause) {
- if (!drv->pause)
- return -EINVAL;
-
dev->pausing = true;
err = drv->pause(dev, pause_state_change_complete);
} else {
* make sure it is valid.
*/
fix_vbus_dev_info(dev);
- if (!drv->resume)
- return -EINVAL;
dev->resuming = true;
err = drv->resume(dev, resume_state_change_complete);