aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r--drivers/scsi/scsi_sysfs.c48
1 files changed, 1 insertions, 47 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index c23ab978c3b..5f85f8e831f 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -376,57 +376,11 @@ static int scsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
376 return 0; 376 return 0;
377} 377}
378 378
379static int scsi_bus_suspend(struct device * dev, pm_message_t state)
380{
381 struct device_driver *drv;
382 struct scsi_device *sdev;
383 int err;
384
385 if (dev->type != &scsi_dev_type)
386 return 0;
387
388 drv = dev->driver;
389 sdev = to_scsi_device(dev);
390
391 err = scsi_device_quiesce(sdev);
392 if (err)
393 return err;
394
395 if (drv && drv->suspend) {
396 err = drv->suspend(dev, state);
397 if (err)
398 return err;
399 }
400
401 return 0;
402}
403
404static int scsi_bus_resume(struct device * dev)
405{
406 struct device_driver *drv;
407 struct scsi_device *sdev;
408 int err = 0;
409
410 if (dev->type != &scsi_dev_type)
411 return 0;
412
413 drv = dev->driver;
414 sdev = to_scsi_device(dev);
415
416 if (drv && drv->resume)
417 err = drv->resume(dev);
418
419 scsi_device_resume(sdev);
420
421 return err;
422}
423
424struct bus_type scsi_bus_type = { 379struct bus_type scsi_bus_type = {
425 .name = "scsi", 380 .name = "scsi",
426 .match = scsi_bus_match, 381 .match = scsi_bus_match,
427 .uevent = scsi_bus_uevent, 382 .uevent = scsi_bus_uevent,
428 .suspend = scsi_bus_suspend, 383 .pm = &scsi_bus_pm_ops,
429 .resume = scsi_bus_resume,
430}; 384};
431EXPORT_SYMBOL_GPL(scsi_bus_type); 385EXPORT_SYMBOL_GPL(scsi_bus_type);
432 386