Commit fe9678fd authored by Russell King's avatar Russell King

[PCMCIA] Drop level argument from pcmcia_socket_dev_* calls.

The driver model changed recently, and instead of providing per-driver
suspend/resume functionality, it now provides it on a per-bus basis.
It also dropped the "level" argument.

Unfortunately, platform device drivers suspend and resume methods
are no longer called by the driver model, so socket drivers using
platform devices won't work correctly.  However, we fix them up as
best we can. (hd64465, i82365, sa1100, tcic)

This cset drops the `level' argument from the PCMCIA suspend/resume
functions since it is now meaningless.
parent f1521af8
...@@ -244,13 +244,10 @@ static const lookup_t service_table[] = { ...@@ -244,13 +244,10 @@ static const lookup_t service_table[] = {
static int socket_resume(struct pcmcia_socket *skt); static int socket_resume(struct pcmcia_socket *skt);
static int socket_suspend(struct pcmcia_socket *skt); static int socket_suspend(struct pcmcia_socket *skt);
int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level) int pcmcia_socket_dev_suspend(struct device *dev, u32 state)
{ {
struct pcmcia_socket *socket; struct pcmcia_socket *socket;
if (level != SUSPEND_SAVE_STATE)
return 0;
down_read(&pcmcia_socket_list_rwsem); down_read(&pcmcia_socket_list_rwsem);
list_for_each_entry(socket, &pcmcia_socket_list, socket_list) { list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
if (socket->dev.dev != dev) if (socket->dev.dev != dev)
...@@ -265,13 +262,10 @@ int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level) ...@@ -265,13 +262,10 @@ int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level)
} }
EXPORT_SYMBOL(pcmcia_socket_dev_suspend); EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
int pcmcia_socket_dev_resume(struct device *dev, u32 level) int pcmcia_socket_dev_resume(struct device *dev)
{ {
struct pcmcia_socket *socket; struct pcmcia_socket *socket;
if (level != RESUME_RESTORE_STATE)
return 0;
down_read(&pcmcia_socket_list_rwsem); down_read(&pcmcia_socket_list_rwsem);
list_for_each_entry(socket, &pcmcia_socket_list, socket_list) { list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
if (socket->dev.dev != dev) if (socket->dev.dev != dev)
......
...@@ -867,19 +867,32 @@ static void hs_exit_socket(hs_socket_t *sp) ...@@ -867,19 +867,32 @@ static void hs_exit_socket(hs_socket_t *sp)
local_irq_restore(flags); local_irq_restore(flags);
} }
static int hd64465_suspend(struct device *dev, u32 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 = { static struct device_driver hd64465_driver = {
.name = "hd64465-pcmcia", .name = "hd64465-pcmcia",
.bus = &platform_bus_type, .bus = &platform_bus_type,
.suspend = pcmcia_socket_dev_suspend, .suspend = hd64465_suspend,
.resume = pcmcia_socket_dev_resume, .resume = hd64465_resume,
}; };
static struct platform_device hd64465_device = { static struct platform_device hd64465_device = {
.name = "hd64465-pcmcia", .name = "hd64465-pcmcia",
.id = 0, .id = 0,
.dev = {
.name = "hd64465-pcmcia",
},
}; };
static int __init init_hs(void) static int __init init_hs(void)
......
...@@ -44,12 +44,12 @@ MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids); ...@@ -44,12 +44,12 @@ MODULE_DEVICE_TABLE(pci, i82092aa_pci_ids);
static int i82092aa_socket_suspend (struct pci_dev *dev, u32 state) static int i82092aa_socket_suspend (struct pci_dev *dev, u32 state)
{ {
return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE); return pcmcia_socket_dev_suspend(&dev->dev, state);
} }
static int i82092aa_socket_resume (struct pci_dev *dev) static int i82092aa_socket_resume (struct pci_dev *dev)
{ {
return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE); return pcmcia_socket_dev_resume(&dev->dev);
} }
static struct pci_driver i82092aa_pci_drv = { static struct pci_driver i82092aa_pci_drv = {
......
...@@ -1351,11 +1351,27 @@ static struct pccard_operations pcic_operations = { ...@@ -1351,11 +1351,27 @@ static struct pccard_operations pcic_operations = {
/*====================================================================*/ /*====================================================================*/
static int i82365_suspend(struct device *dev, u32 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 = { static struct device_driver i82365_driver = {
.name = "i82365", .name = "i82365",
.bus = &platform_bus_type, .bus = &platform_bus_type,
.suspend = pcmcia_socket_dev_suspend, .suspend = i82365_suspend,
.resume = pcmcia_socket_dev_resume, .resume = i82365_resume,
}; };
static struct platform_device i82365_device = { static struct platform_device i82365_device = {
......
...@@ -100,13 +100,29 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev) ...@@ -100,13 +100,29 @@ static int sa11x0_drv_pcmcia_probe(struct device *dev)
return ret; return ret;
} }
static int sa11x0_drv_pcmcia_suspend(struct device *dev, u32 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 = { static struct device_driver sa11x0_pcmcia_driver = {
.probe = sa11x0_drv_pcmcia_probe, .probe = sa11x0_drv_pcmcia_probe,
.remove = sa11xx_drv_pcmcia_remove, .remove = sa11xx_drv_pcmcia_remove,
.name = "sa11x0-pcmcia", .name = "sa11x0-pcmcia",
.bus = &platform_bus_type, .bus = &platform_bus_type,
.suspend = pcmcia_socket_dev_suspend, .suspend = sa11x0_drv_pcmcia_suspend,
.resume = pcmcia_socket_dev_resume, .resume = sa11x0_drv_pcmcia_resume,
}; };
/* sa11x0_pcmcia_init() /* sa11x0_pcmcia_init()
......
...@@ -171,12 +171,12 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev) ...@@ -171,12 +171,12 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
static int pcmcia_suspend(struct sa1111_dev *dev, u32 state) static int pcmcia_suspend(struct sa1111_dev *dev, u32 state)
{ {
return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE); return pcmcia_socket_dev_suspend(&dev->dev, state);
} }
static int pcmcia_resume(struct sa1111_dev *dev) static int pcmcia_resume(struct sa1111_dev *dev)
{ {
return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE); return pcmcia_socket_dev_resume(&dev->dev);
} }
static struct sa1111_driver pcmcia_driver = { static struct sa1111_driver pcmcia_driver = {
......
...@@ -362,11 +362,27 @@ static int __init get_tcic_id(void) ...@@ -362,11 +362,27 @@ static int __init get_tcic_id(void)
/*====================================================================*/ /*====================================================================*/
static int tcic_drv_suspend(struct device *dev, u32 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 = { static struct device_driver tcic_driver = {
.name = "tcic-pcmcia", .name = "tcic-pcmcia",
.bus = &platform_bus_type, .bus = &platform_bus_type,
.suspend = pcmcia_socket_dev_suspend, .suspend = tcic_drv_suspend,
.resume = pcmcia_socket_dev_resume, .resume = tcic_drv_resume,
}; };
static struct platform_device tcic_device = { static struct platform_device tcic_device = {
......
...@@ -933,7 +933,7 @@ static int yenta_dev_suspend (struct pci_dev *dev, u32 state) ...@@ -933,7 +933,7 @@ static int yenta_dev_suspend (struct pci_dev *dev, u32 state)
struct yenta_socket *socket = pci_get_drvdata(dev); struct yenta_socket *socket = pci_get_drvdata(dev);
int ret; int ret;
ret = pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE); ret = pcmcia_socket_dev_suspend(&dev->dev, state);
if (socket) { if (socket) {
if (socket->type && socket->type->save_state) if (socket->type && socket->type->save_state)
...@@ -965,7 +965,7 @@ static int yenta_dev_resume (struct pci_dev *dev) ...@@ -965,7 +965,7 @@ static int yenta_dev_resume (struct pci_dev *dev)
socket->type->restore_state(socket); socket->type->restore_state(socket);
} }
return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE); return pcmcia_socket_dev_resume(&dev->dev);
} }
......
...@@ -247,7 +247,7 @@ extern void pcmcia_unregister_socket(struct pcmcia_socket *socket); ...@@ -247,7 +247,7 @@ extern void pcmcia_unregister_socket(struct pcmcia_socket *socket);
extern struct class pcmcia_socket_class; extern struct class pcmcia_socket_class;
/* socket drivers are expected to use these callbacks in their .drv struct */ /* socket drivers are expected to use these callbacks in their .drv struct */
extern int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level); extern int pcmcia_socket_dev_suspend(struct device *dev, u32 state);
extern int pcmcia_socket_dev_resume(struct device *dev, u32 level); extern int pcmcia_socket_dev_resume(struct device *dev);
#endif /* _LINUX_SS_H */ #endif /* _LINUX_SS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment