• A
    [SCSI] scsi_pm: use callbacks from dev_pm_ops for scsi devices · 80d2fd48
    Aaron Lu 提交于
    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: NAaron Lu <aaron.lu@intel.com>
    Acked-by: NAlan Stern <stern@rowland.harvard.edu>
    Acked-by: NRafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
    80d2fd48
scsi_pm.c 5.8 KB