aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:23:14 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 18:03:10 -0500
commitcc3b4866bee996c922e875b8c8efe9f0d8803aae (patch)
tree6632837b6986f33566f75ed971cecbdc210e3201 /drivers/serial/serial_cs.c
parent8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (diff)
[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 <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/serial/serial_cs.c')
-rw-r--r--drivers/serial/serial_cs.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c
index 3487ee9eab1d..a95366366504 100644
--- a/drivers/serial/serial_cs.c
+++ b/drivers/serial/serial_cs.c
@@ -120,7 +120,7 @@ static int serial_event(event_t event, int priority,
120static dev_info_t dev_info = "serial_cs"; 120static dev_info_t dev_info = "serial_cs";
121 121
122static dev_link_t *serial_attach(void); 122static dev_link_t *serial_attach(void);
123static void serial_detach(dev_link_t *); 123static void serial_detach(struct pcmcia_device *p_dev);
124 124
125static dev_link_t *dev_list = NULL; 125static dev_link_t *dev_list = NULL;
126 126
@@ -242,7 +242,7 @@ static dev_link_t *serial_attach(void)
242 ret = pcmcia_register_client(&link->handle, &client_reg); 242 ret = pcmcia_register_client(&link->handle, &client_reg);
243 if (ret != CS_SUCCESS) { 243 if (ret != CS_SUCCESS) {
244 cs_error(link->handle, RegisterClient, ret); 244 cs_error(link->handle, RegisterClient, ret);
245 serial_detach(link); 245 serial_detach(link->handle);
246 return NULL; 246 return NULL;
247 } 247 }
248 248
@@ -258,11 +258,11 @@ static dev_link_t *serial_attach(void)
258 258
259======================================================================*/ 259======================================================================*/
260 260
261static void serial_detach(dev_link_t * link) 261static void serial_detach(struct pcmcia_device *p_dev)
262{ 262{
263 dev_link_t *link = dev_to_instance(p_dev);
263 struct serial_info *info = link->priv; 264 struct serial_info *info = link->priv;
264 dev_link_t **linkp; 265 dev_link_t **linkp;
265 int ret;
266 266
267 DEBUG(0, "serial_detach(0x%p)\n", link); 267 DEBUG(0, "serial_detach(0x%p)\n", link);
268 268
@@ -283,12 +283,6 @@ static void serial_detach(dev_link_t * link)
283 */ 283 */
284 serial_remove(link); 284 serial_remove(link);
285 285
286 if (link->handle) {
287 ret = pcmcia_deregister_client(link->handle);
288 if (ret != CS_SUCCESS)
289 cs_error(link->handle, DeregisterClient, ret);
290 }
291
292 /* Unlink device structure, free bits */ 286 /* Unlink device structure, free bits */
293 *linkp = link->next; 287 *linkp = link->next;
294 kfree(info); 288 kfree(info);
@@ -741,9 +735,6 @@ serial_event(event_t event, int priority, event_callback_args_t * args)
741 DEBUG(1, "serial_event(0x%06x)\n", event); 735 DEBUG(1, "serial_event(0x%06x)\n", event);
742 736
743 switch (event) { 737 switch (event) {
744 case CS_EVENT_CARD_REMOVAL:
745 serial_remove(link);
746 break;
747 738
748 case CS_EVENT_CARD_INSERTION: 739 case CS_EVENT_CARD_INSERTION:
749 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 740 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
@@ -866,7 +857,7 @@ static struct pcmcia_driver serial_cs_driver = {
866 }, 857 },
867 .attach = serial_attach, 858 .attach = serial_attach,
868 .event = serial_event, 859 .event = serial_event,
869 .detach = serial_detach, 860 .remove = serial_detach,
870 .id_table = serial_ids, 861 .id_table = serial_ids,
871 .suspend = serial_suspend, 862 .suspend = serial_suspend,
872 .resume = serial_resume, 863 .resume = serial_resume,