[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a3a3395e48
commit
9480e307cd
@ -133,13 +133,9 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state)
|
||||
int ret = 0;
|
||||
struct device_driver *drv = dev->driver;
|
||||
|
||||
if (drv && drv->suspend) {
|
||||
ret = drv->suspend(dev, state, SUSPEND_DISABLE);
|
||||
if (ret == 0)
|
||||
ret = drv->suspend(dev, state, SUSPEND_SAVE_STATE);
|
||||
if (ret == 0)
|
||||
ret = drv->suspend(dev, state, SUSPEND_POWER_DOWN);
|
||||
}
|
||||
if (drv && drv->suspend)
|
||||
ret = drv->suspend(dev, state);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -148,13 +144,9 @@ static int mdio_bus_resume(struct device * dev)
|
||||
int ret = 0;
|
||||
struct device_driver *drv = dev->driver;
|
||||
|
||||
if (drv && drv->resume) {
|
||||
ret = drv->resume(dev, RESUME_POWER_ON);
|
||||
if (ret == 0)
|
||||
ret = drv->resume(dev, RESUME_RESTORE_STATE);
|
||||
if (ret == 0)
|
||||
ret = drv->resume(dev, RESUME_ENABLE);
|
||||
}
|
||||
if (drv && drv->resume)
|
||||
ret = drv->resume(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user