From 80d2fd48cca2a0de806c3130551744a04ad5b80b Mon Sep 17 00:00:00 2001 From: Aaron Lu Date: Fri, 9 Nov 2012 15:27:54 +0800 Subject: [PATCH] [SCSI] scsi_pm: use callbacks from dev_pm_ops for scsi devices Use of pm_message_t is deprecated and device driver is not supposed to use that. This patch migrates the SCSI bus level pm callbacks to call device's pm callbacks defined in its driver's dev_pm_ops. This is achieved by finding out which device pm callback should be used in bus callback function, and then pass that callback function pointer as a param to the scsi_bus_{suspend,resume}_common routine, which will further pass that callback to scsi_dev_type_{suspend,resume} after proper handling. The special case for freeze in scsi_bus_suspend_common is not necessary since there is no high level SCSI driver has implemented freeze, so no need to runtime resume the device if it is in runtime suspended state for system freeze, just return like the system suspend/hibernate case. Since only sd has implemented drv->suspend/drv->resume, and I'll update sd driver to use the new callbacks in the following patch, there is no need to fallback to call drv->suspend/drv->resume if dev_pm_ops is NULL. Signed-off-by: Aaron Lu Acked-by: Alan Stern Acked-by: Rafael J. Wysocki Signed-off-by: James Bottomley --- Reading git-format-patch failed