aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/fdomain_stub.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/scsi/pcmcia/fdomain_stub.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/scsi/pcmcia/fdomain_stub.c')
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 9e1d68c14694..5842c938fff5 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -84,7 +84,7 @@ static int fdomain_event(event_t event, int priority,
84 event_callback_args_t *args); 84 event_callback_args_t *args);
85 85
86static dev_link_t *fdomain_attach(void); 86static dev_link_t *fdomain_attach(void);
87static void fdomain_detach(dev_link_t *); 87static void fdomain_detach(struct pcmcia_device *p_dev);
88 88
89 89
90static dev_link_t *dev_list = NULL; 90static dev_link_t *dev_list = NULL;
@@ -124,7 +124,7 @@ static dev_link_t *fdomain_attach(void)
124 ret = pcmcia_register_client(&link->handle, &client_reg); 124 ret = pcmcia_register_client(&link->handle, &client_reg);
125 if (ret != 0) { 125 if (ret != 0) {
126 cs_error(link->handle, RegisterClient, ret); 126 cs_error(link->handle, RegisterClient, ret);
127 fdomain_detach(link); 127 fdomain_detach(link->handle);
128 return NULL; 128 return NULL;
129 } 129 }
130 130
@@ -133,8 +133,9 @@ static dev_link_t *fdomain_attach(void)
133 133
134/*====================================================================*/ 134/*====================================================================*/
135 135
136static void fdomain_detach(dev_link_t *link) 136static void fdomain_detach(struct pcmcia_device *p_dev)
137{ 137{
138 dev_link_t *link = dev_to_instance(p_dev);
138 dev_link_t **linkp; 139 dev_link_t **linkp;
139 140
140 DEBUG(0, "fdomain_detach(0x%p)\n", link); 141 DEBUG(0, "fdomain_detach(0x%p)\n", link);
@@ -148,9 +149,6 @@ static void fdomain_detach(dev_link_t *link)
148 if (link->state & DEV_CONFIG) 149 if (link->state & DEV_CONFIG)
149 fdomain_release(link); 150 fdomain_release(link);
150 151
151 if (link->handle)
152 pcmcia_deregister_client(link->handle);
153
154 /* Unlink device structure, free bits */ 152 /* Unlink device structure, free bits */
155 *linkp = link->next; 153 *linkp = link->next;
156 kfree(link->priv); 154 kfree(link->priv);
@@ -288,11 +286,6 @@ static int fdomain_event(event_t event, int priority,
288 DEBUG(1, "fdomain_event(0x%06x)\n", event); 286 DEBUG(1, "fdomain_event(0x%06x)\n", event);
289 287
290 switch (event) { 288 switch (event) {
291 case CS_EVENT_CARD_REMOVAL:
292 link->state &= ~DEV_PRESENT;
293 if (link->state & DEV_CONFIG)
294 fdomain_release(link);
295 break;
296 case CS_EVENT_CARD_INSERTION: 289 case CS_EVENT_CARD_INSERTION:
297 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 290 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
298 fdomain_config(link); 291 fdomain_config(link);
@@ -317,7 +310,7 @@ static struct pcmcia_driver fdomain_cs_driver = {
317 }, 310 },
318 .attach = fdomain_attach, 311 .attach = fdomain_attach,
319 .event = fdomain_event, 312 .event = fdomain_event,
320 .detach = fdomain_detach, 313 .remove = fdomain_detach,
321 .id_table = fdomain_ids, 314 .id_table = fdomain_ids,
322 .suspend = fdomain_suspend, 315 .suspend = fdomain_suspend,
323 .resume = fdomain_resume, 316 .resume = fdomain_resume,