diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-14 15:23:14 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:03:10 -0500 |
commit | cc3b4866bee996c922e875b8c8efe9f0d8803aae (patch) | |
tree | 6632837b6986f33566f75ed971cecbdc210e3201 /drivers/scsi/pcmcia/aha152x_stub.c | |
parent | 8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (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/aha152x_stub.c')
-rw-r--r-- | drivers/scsi/pcmcia/aha152x_stub.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 82988a3e35ec..3128ba8c57a9 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c | |||
@@ -99,7 +99,7 @@ static int aha152x_event(event_t event, int priority, | |||
99 | event_callback_args_t *args); | 99 | event_callback_args_t *args); |
100 | 100 | ||
101 | static dev_link_t *aha152x_attach(void); | 101 | static dev_link_t *aha152x_attach(void); |
102 | static void aha152x_detach(dev_link_t *); | 102 | static void aha152x_detach(struct pcmcia_device *p_dev); |
103 | 103 | ||
104 | static dev_link_t *dev_list; | 104 | static dev_link_t *dev_list; |
105 | static dev_info_t dev_info = "aha152x_cs"; | 105 | static dev_info_t dev_info = "aha152x_cs"; |
@@ -138,7 +138,7 @@ static dev_link_t *aha152x_attach(void) | |||
138 | ret = pcmcia_register_client(&link->handle, &client_reg); | 138 | ret = pcmcia_register_client(&link->handle, &client_reg); |
139 | if (ret != 0) { | 139 | if (ret != 0) { |
140 | cs_error(link->handle, RegisterClient, ret); | 140 | cs_error(link->handle, RegisterClient, ret); |
141 | aha152x_detach(link); | 141 | aha152x_detach(link->handle); |
142 | return NULL; | 142 | return NULL; |
143 | } | 143 | } |
144 | 144 | ||
@@ -147,8 +147,9 @@ static dev_link_t *aha152x_attach(void) | |||
147 | 147 | ||
148 | /*====================================================================*/ | 148 | /*====================================================================*/ |
149 | 149 | ||
150 | static void aha152x_detach(dev_link_t *link) | 150 | static void aha152x_detach(struct pcmcia_device *p_dev) |
151 | { | 151 | { |
152 | dev_link_t *link = dev_to_instance(p_dev); | ||
152 | dev_link_t **linkp; | 153 | dev_link_t **linkp; |
153 | 154 | ||
154 | DEBUG(0, "aha152x_detach(0x%p)\n", link); | 155 | DEBUG(0, "aha152x_detach(0x%p)\n", link); |
@@ -162,9 +163,6 @@ static void aha152x_detach(dev_link_t *link) | |||
162 | if (link->state & DEV_CONFIG) | 163 | if (link->state & DEV_CONFIG) |
163 | aha152x_release_cs(link); | 164 | aha152x_release_cs(link); |
164 | 165 | ||
165 | if (link->handle) | ||
166 | pcmcia_deregister_client(link->handle); | ||
167 | |||
168 | /* Unlink device structure, free bits */ | 166 | /* Unlink device structure, free bits */ |
169 | *linkp = link->next; | 167 | *linkp = link->next; |
170 | kfree(link->priv); | 168 | kfree(link->priv); |
@@ -307,11 +305,6 @@ static int aha152x_event(event_t event, int priority, | |||
307 | DEBUG(0, "aha152x_event(0x%06x)\n", event); | 305 | DEBUG(0, "aha152x_event(0x%06x)\n", event); |
308 | 306 | ||
309 | switch (event) { | 307 | switch (event) { |
310 | case CS_EVENT_CARD_REMOVAL: | ||
311 | link->state &= ~DEV_PRESENT; | ||
312 | if (link->state & DEV_CONFIG) | ||
313 | aha152x_release_cs(link); | ||
314 | break; | ||
315 | case CS_EVENT_CARD_INSERTION: | 308 | case CS_EVENT_CARD_INSERTION: |
316 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 309 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
317 | aha152x_config_cs(link); | 310 | aha152x_config_cs(link); |
@@ -337,7 +330,7 @@ static struct pcmcia_driver aha152x_cs_driver = { | |||
337 | }, | 330 | }, |
338 | .attach = aha152x_attach, | 331 | .attach = aha152x_attach, |
339 | .event = aha152x_event, | 332 | .event = aha152x_event, |
340 | .detach = aha152x_detach, | 333 | .remove = aha152x_detach, |
341 | .id_table = aha152x_ids, | 334 | .id_table = aha152x_ids, |
342 | .suspend = aha152x_suspend, | 335 | .suspend = aha152x_suspend, |
343 | .resume = aha152x_resume, | 336 | .resume = aha152x_resume, |