You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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
@@ -519,30 +519,13 @@ static int au1x00_drv_pcmcia_probe(struct device *dev)
|
||||
}
|
||||
|
||||
|
||||
static int au1x00_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int au1x00_drv_pcmcia_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static struct device_driver au1x00_pcmcia_driver = {
|
||||
.probe = au1x00_drv_pcmcia_probe,
|
||||
.remove = au1x00_drv_pcmcia_remove,
|
||||
.name = "au1x00-pcmcia",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = au1x00_drv_pcmcia_suspend,
|
||||
.resume = au1x00_drv_pcmcia_resume
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static struct platform_device au1x00_device = {
|
||||
|
||||
@@ -844,27 +844,11 @@ static void hs_exit_socket(hs_socket_t *sp)
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
|
||||
static int hd64465_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hd64465_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct device_driver hd64465_driver = {
|
||||
.name = "hd64465-pcmcia",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = hd64465_suspend,
|
||||
.resume = hd64465_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static struct platform_device hd64465_device = {
|
||||
|
||||
+2
-18
@@ -1332,27 +1332,11 @@ static struct pccard_operations pcic_operations = {
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int i82365_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int i82365_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct device_driver i82365_driver = {
|
||||
.name = "i82365",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = i82365_suspend,
|
||||
.resume = i82365_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static struct platform_device i82365_device = {
|
||||
|
||||
@@ -731,28 +731,11 @@ static struct pccard_operations pcc_operations = {
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int m32r_pcc_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static struct device_driver pcc_driver = {
|
||||
.name = "cfc",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = m32r_pcc_suspend,
|
||||
.resume = m32r_pcc_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static struct platform_device pcc_device = {
|
||||
|
||||
@@ -695,28 +695,11 @@ static struct pccard_operations pcc_operations = {
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int m32r_pcc_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int m32r_pcc_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static struct device_driver pcc_driver = {
|
||||
.name = "pcc",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = m32r_pcc_suspend,
|
||||
.resume = m32r_pcc_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static struct platform_device pcc_device = {
|
||||
|
||||
@@ -329,27 +329,13 @@ static int __devexit omap_cf_remove(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int omap_cf_suspend(struct device *dev, pm_message_t mesg, u32 level)
|
||||
{
|
||||
if (level != SUSPEND_SAVE_STATE)
|
||||
return 0;
|
||||
return pcmcia_socket_dev_suspend(dev, mesg);
|
||||
}
|
||||
|
||||
static int omap_cf_resume(struct device *dev, u32 level)
|
||||
{
|
||||
if (level != RESUME_RESTORE_STATE)
|
||||
return 0;
|
||||
return pcmcia_socket_dev_resume(dev);
|
||||
}
|
||||
|
||||
static struct device_driver omap_cf_driver = {
|
||||
.name = (char *) driver_name,
|
||||
.bus = &platform_bus_type,
|
||||
.probe = omap_cf_probe,
|
||||
.remove = __devexit_p(omap_cf_remove),
|
||||
.suspend = omap_cf_suspend,
|
||||
.resume = omap_cf_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static int __init omap_cf_init(void)
|
||||
|
||||
@@ -205,32 +205,20 @@ int pxa2xx_drv_pcmcia_probe(struct device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL(pxa2xx_drv_pcmcia_probe);
|
||||
|
||||
static int pxa2xx_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
static int pxa2xx_drv_pcmcia_resume(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
struct pcmcia_low_level *ops = dev->platform_data;
|
||||
int nr = ops ? ops->nr : 0;
|
||||
|
||||
static int pxa2xx_drv_pcmcia_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
{
|
||||
struct pcmcia_low_level *ops = dev->platform_data;
|
||||
int nr = ops ? ops->nr : 0;
|
||||
MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0);
|
||||
|
||||
MECR = nr > 1 ? MECR_CIT | MECR_NOS : (nr > 0 ? MECR_CIT : 0);
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
}
|
||||
return ret;
|
||||
return pcmcia_socket_dev_resume(dev);
|
||||
}
|
||||
|
||||
static struct device_driver pxa2xx_pcmcia_driver = {
|
||||
.probe = pxa2xx_drv_pcmcia_probe,
|
||||
.remove = soc_common_drv_pcmcia_remove,
|
||||
.suspend = pxa2xx_drv_pcmcia_suspend,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pxa2xx_drv_pcmcia_resume,
|
||||
.name = "pxa2xx-pcmcia",
|
||||
.bus = &platform_bus_type,
|
||||
|
||||
@@ -74,29 +74,13 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sa11x0_drv_pcmcia_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct device_driver sa11x0_pcmcia_driver = {
|
||||
.probe = sa11x0_drv_pcmcia_probe,
|
||||
.remove = soc_common_drv_pcmcia_remove,
|
||||
.name = "sa11x0-pcmcia",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = sa11x0_drv_pcmcia_suspend,
|
||||
.resume = sa11x0_drv_pcmcia_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
/* sa11x0_pcmcia_init()
|
||||
|
||||
+2
-18
@@ -372,27 +372,11 @@ static int __init get_tcic_id(void)
|
||||
|
||||
/*====================================================================*/
|
||||
|
||||
static int tcic_drv_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
ret = pcmcia_socket_dev_suspend(dev, state);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int tcic_drv_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int ret = 0;
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
ret = pcmcia_socket_dev_resume(dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct device_driver tcic_driver = {
|
||||
.name = "tcic-pcmcia",
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = tcic_drv_suspend,
|
||||
.resume = tcic_drv_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static struct platform_device tcic_device = {
|
||||
|
||||
@@ -774,31 +774,11 @@ static int __devinit vrc4171_card_setup(char *options)
|
||||
|
||||
__setup("vrc4171_card=", vrc4171_card_setup);
|
||||
|
||||
static int vrc4171_card_suspend(struct device *dev, pm_message_t state, u32 level)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
if (level == SUSPEND_SAVE_STATE)
|
||||
retval = pcmcia_socket_dev_suspend(dev, state);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int vrc4171_card_resume(struct device *dev, u32 level)
|
||||
{
|
||||
int retval = 0;
|
||||
|
||||
if (level == RESUME_RESTORE_STATE)
|
||||
retval = pcmcia_socket_dev_resume(dev);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static struct device_driver vrc4171_card_driver = {
|
||||
.name = vrc4171_card_name,
|
||||
.bus = &platform_bus_type,
|
||||
.suspend = vrc4171_card_suspend,
|
||||
.resume = vrc4171_card_resume,
|
||||
.suspend = pcmcia_socket_dev_suspend,
|
||||
.resume = pcmcia_socket_dev_resume,
|
||||
};
|
||||
|
||||
static int __devinit vrc4171_card_init(void)
|
||||
|
||||
Reference in New Issue
Block a user