static int scsi_dev_type_suspend(struct device *dev, pm_message_t msg) { struct device_driver *drv; int err; err = scsi_device_quiesce(to_scsi_device(dev)); if (err == 0) { drv = dev->driver; if (drv && drv->suspend) err = drv->suspend(dev, msg); } dev_dbg(dev, "scsi suspend: %d\n", err); return err; }
static int scsi_dev_type_suspend(struct device *dev, int (*cb)(struct device *)) { int err; err = scsi_device_quiesce(to_scsi_device(dev)); if (err == 0) { if (cb) { err = cb(dev); if (err) scsi_device_resume(to_scsi_device(dev)); } } dev_dbg(dev, "scsi suspend: %d\n", err); return err; }
static int scsi_dev_type_suspend(struct device *dev, int (*cb)(struct device *, const struct dev_pm_ops *)) { const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; int err; /* flush pending in-flight resume operations, suspend is synchronous */ async_synchronize_full_domain(&scsi_sd_pm_domain); err = scsi_device_quiesce(to_scsi_device(dev)); if (err == 0) { err = cb(dev, pm); if (err) scsi_device_resume(to_scsi_device(dev)); } dev_dbg(dev, "scsi suspend: %d\n", err); return err; }