[SCSI] sd: check runtime PM status in sd_shutdown
authorLin Ming <ming.m.lin@intel.com>
Mon, 5 Dec 2011 01:20:26 +0000 (09:20 +0800)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 9 Jan 2012 00:14:57 +0000 (19:14 -0500)
commit54f57588463db1105f4a93b2902a6f95cb8f796a
tree5a8f50a836f49db68f994de214fdcaacda337151
parent286405167e815adc4ae0132214246a350b0208bc
[SCSI] sd: check runtime PM status in sd_shutdown

sd_shutdown is called during reboot/poweroff.
It may fail if parent device, for example, ata port, was runtime suspended.

Fix it by checking runtime PM status of sd.
Exit immediately if sd was runtime suspended already.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/scsi/sd.c