From 98e4c28b7ec390c2dad6a4c69d69629c0f7e8b10 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Mon, 14 Nov 2005 21:21:18 +0100 Subject: [PATCH] pcmcia: new suspend core Move the suspend and resume methods out of the event handler, and into special functions. Also use these functions for pre- and post-reset, as almost all drivers already do, and the remaining ones can easily be converted. Bugfix to include/pcmcia/ds.c Signed-off-by: Andrew Morton Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/pcmcia/ds.h') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index cb8b6e6ce66..02005519900 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -137,6 +137,10 @@ struct pcmcia_driver { int (*event) (event_t event, int priority, event_callback_args_t *); void (*detach)(dev_link_t *); + + int (*suspend) (struct pcmcia_device *dev); + int (*resume) (struct pcmcia_device *dev); + struct module *owner; struct pcmcia_device_id *id_table; struct device_driver drv; @@ -193,6 +197,8 @@ struct pcmcia_device { #define handle_to_pdev(handle) (handle) #define handle_to_dev(handle) (handle->dev) +#define dev_to_instance(dev) (dev->instance) + /* error reporting */ void cs_error(client_handle_t handle, int func, int ret); -- cgit v1.2.3 From cc3b4866bee996c922e875b8c8efe9f0d8803aae Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Mon, 14 Nov 2005 21:23:14 +0100 Subject: [PATCH] pcmcia: unify detach, REMOVAL_EVENT handlers into one remove callback Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function. Old functionality is preserved, for the moment. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/pcmcia/ds.h') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 02005519900..2869283acd1 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -138,6 +138,8 @@ struct pcmcia_driver { event_callback_args_t *); void (*detach)(dev_link_t *); + void (*remove) (struct pcmcia_device *dev); + int (*suspend) (struct pcmcia_device *dev); int (*resume) (struct pcmcia_device *dev); -- cgit v1.2.3 From f3990715589d378a2d3aa9b8accd78bb4a2378b7 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Mon, 14 Nov 2005 21:25:23 +0100 Subject: [PATCH] pcmcia: remove old detach mechanism Remove the old "detach" mechanism as it is unused now. Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/pcmcia/ds.h') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 2869283acd1..c53a0604e44 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -136,7 +136,6 @@ struct pcmcia_driver { dev_link_t *(*attach)(void); int (*event) (event_t event, int priority, event_callback_args_t *); - void (*detach)(dev_link_t *); void (*remove) (struct pcmcia_device *dev); -- cgit v1.2.3 From f8cfa618dccbdc6dab5297f75779566a388a98fd Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Mon, 14 Nov 2005 21:25:51 +0100 Subject: [PATCH] pcmcia: unify attach, EVENT_CARD_INSERTION handlers into one probe callback Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified probe() callback. As all in-kernel drivers are changed to this new callback, there will be no temporary backwards-compatibility. Inside a probe() function, each driver _must_ set struct pcmcia_device *p_dev->instance and instance->handle correctly. With these patches, the basic driver interface for 16-bit PCMCIA drivers now has the classic four callbacks known also from other buses: int (*probe) (struct pcmcia_device *dev); void (*remove) (struct pcmcia_device *dev); int (*suspend) (struct pcmcia_device *dev); int (*resume) (struct pcmcia_device *dev); Signed-off-by: Dominik Brodowski --- include/pcmcia/ds.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include/pcmcia/ds.h') diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index c53a0604e44..8e2a9639647 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -133,10 +133,7 @@ typedef struct dev_link_t { struct pcmcia_socket; struct pcmcia_driver { - dev_link_t *(*attach)(void); - int (*event) (event_t event, int priority, - event_callback_args_t *); - + int (*probe) (struct pcmcia_device *dev); void (*remove) (struct pcmcia_device *dev); int (*suspend) (struct pcmcia_device *dev); @@ -169,7 +166,6 @@ struct pcmcia_device { /* deprecated, a cleaned up version will be moved into this struct soon */ dev_link_t *instance; - event_callback_args_t event_callback_args; u_int state; /* information about this device */ -- cgit v1.2.3