diff options
author | Tejun Heo <htejun@gmail.com> | 2007-03-21 03:05:16 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-22 11:41:12 -0400 |
commit | 1dfcda06a67d6ad6f890dbd1bab84be5f17ef46d (patch) | |
tree | c327bdbb97f70f609fb9f3a19f263a493cee5b96 /drivers/scsi/scsi_sysfs.c | |
parent | 67b2009ae26ece6a54d0b689827903f53d6d21e6 (diff) |
[SCSI] kill scsi host template suspend/resume
With libata converted to use sdev->manage_start_stop for suspend and
resume, sht->suspend/resume() has no user left and low level
suspend/ressume should be taken care of by low level driver's
suspend/resume callbacks (e.g. PCI or PCMCIA driver callbacks). This
patch removes sht->suspend/resume() callbacks.
This change is suggested by Christoph Hellwig.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 67a38a1409ba..ed720863ab97 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -293,30 +293,18 @@ static int scsi_bus_suspend(struct device * dev, pm_message_t state) | |||
293 | { | 293 | { |
294 | struct device_driver *drv = dev->driver; | 294 | struct device_driver *drv = dev->driver; |
295 | struct scsi_device *sdev = to_scsi_device(dev); | 295 | struct scsi_device *sdev = to_scsi_device(dev); |
296 | struct scsi_host_template *sht = sdev->host->hostt; | ||
297 | int err; | 296 | int err; |
298 | 297 | ||
299 | err = scsi_device_quiesce(sdev); | 298 | err = scsi_device_quiesce(sdev); |
300 | if (err) | 299 | if (err) |
301 | return err; | 300 | return err; |
302 | 301 | ||
303 | /* call HLD suspend first */ | ||
304 | if (drv && drv->suspend) { | 302 | if (drv && drv->suspend) { |
305 | err = drv->suspend(dev, state); | 303 | err = drv->suspend(dev, state); |
306 | if (err) | 304 | if (err) |
307 | return err; | 305 | return err; |
308 | } | 306 | } |
309 | 307 | ||
310 | /* then, call host suspend */ | ||
311 | if (sht->suspend) { | ||
312 | err = sht->suspend(sdev, state); | ||
313 | if (err) { | ||
314 | if (drv && drv->resume) | ||
315 | drv->resume(dev); | ||
316 | return err; | ||
317 | } | ||
318 | } | ||
319 | |||
320 | return 0; | 308 | return 0; |
321 | } | 309 | } |
322 | 310 | ||
@@ -324,21 +312,14 @@ static int scsi_bus_resume(struct device * dev) | |||
324 | { | 312 | { |
325 | struct device_driver *drv = dev->driver; | 313 | struct device_driver *drv = dev->driver; |
326 | struct scsi_device *sdev = to_scsi_device(dev); | 314 | struct scsi_device *sdev = to_scsi_device(dev); |
327 | struct scsi_host_template *sht = sdev->host->hostt; | 315 | int err = 0; |
328 | int err = 0, err2 = 0; | ||
329 | |||
330 | /* call host resume first */ | ||
331 | if (sht->resume) | ||
332 | err = sht->resume(sdev); | ||
333 | 316 | ||
334 | /* then, call HLD resume */ | ||
335 | if (drv && drv->resume) | 317 | if (drv && drv->resume) |
336 | err2 = drv->resume(dev); | 318 | err = drv->resume(dev); |
337 | 319 | ||
338 | scsi_device_resume(sdev); | 320 | scsi_device_resume(sdev); |
339 | 321 | ||
340 | /* favor LLD failure */ | 322 | return err; |
341 | return err ? err : err2;; | ||
342 | } | 323 | } |
343 | 324 | ||
344 | struct bus_type scsi_bus_type = { | 325 | struct bus_type scsi_bus_type = { |