[PATCH 6/13] pcmcia: convert serial_cs to use new suspend mechanism
Dominik Brodowski
linux at dominikbrodowski.net
Wed Sep 7 17:37:06 EDT 2005
Update the serial_cs driver for the suspend/resume changes.
Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>
---
drivers/serial/serial_cs.c | 31 ++++++++++---------------------
1 files changed, 10 insertions(+), 21 deletions(-)
Index: 2.6.13-git4/drivers/serial/serial_cs.c
===================================================================
--- 2.6.13-git4.orig/drivers/serial/serial_cs.c
+++ 2.6.13-git4/drivers/serial/serial_cs.c
@@ -159,8 +159,9 @@ static void serial_remove(dev_link_t *li
}
}
-static void serial_suspend(dev_link_t *link)
+static int serial_suspend(struct pcmcia_device *dev)
{
+ dev_link_t *link = dev_to_instance(dev);
link->state |= DEV_SUSPEND;
if (link->state & DEV_CONFIG) {
@@ -173,10 +174,13 @@ static void serial_suspend(dev_link_t *l
if (!info->slave)
pcmcia_release_configuration(link->handle);
}
+
+ return 0;
}
-static void serial_resume(dev_link_t *link)
+static int serial_resume(struct pcmcia_device *dev)
{
+ dev_link_t *link = dev_to_instance(dev);
link->state &= ~DEV_SUSPEND;
if (DEV_OK(link)) {
@@ -189,6 +193,8 @@ static void serial_resume(dev_link_t *li
for (i = 0; i < info->ndev; i++)
serial8250_resume_port(info->line[i]);
}
+
+ return 0;
}
/*======================================================================
@@ -731,7 +737,6 @@ static int
serial_event(event_t event, int priority, event_callback_args_t * args)
{
dev_link_t *link = args->client_data;
- struct serial_info *info = link->priv;
DEBUG(1, "serial_event(0x%06x)\n", event);
@@ -744,24 +749,6 @@ serial_event(event_t event, int priority
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
serial_config(link);
break;
-
- case CS_EVENT_PM_SUSPEND:
- serial_suspend(link);
- break;
-
- case CS_EVENT_RESET_PHYSICAL:
- if ((link->state & DEV_CONFIG) && !info->slave)
- pcmcia_release_configuration(link->handle);
- break;
-
- case CS_EVENT_PM_RESUME:
- serial_resume(link);
- break;
-
- case CS_EVENT_CARD_RESET:
- if (DEV_OK(link) && !info->slave)
- pcmcia_request_configuration(link->handle, &link->conf);
- break;
}
return 0;
}
@@ -880,6 +867,8 @@ static struct pcmcia_driver serial_cs_dr
.event = serial_event,
.detach = serial_detach,
.id_table = serial_ids,
+ .suspend = serial_suspend,
+ .resume = serial_resume,
};
static int __init init_serial_cs(void)
More information about the linux-pcmcia
mailing list