aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
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/ide
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/ide')
-rw-r--r--drivers/ide/legacy/ide-cs.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 982b74af8c29..1fb8976496d9 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -94,7 +94,7 @@ static int ide_event(event_t event, int priority,
94static dev_info_t dev_info = "ide-cs"; 94static dev_info_t dev_info = "ide-cs";
95 95
96static dev_link_t *ide_attach(void); 96static dev_link_t *ide_attach(void);
97static void ide_detach(dev_link_t *); 97static void ide_detach(struct pcmcia_device *p_dev);
98 98
99static dev_link_t *dev_list = NULL; 99static dev_link_t *dev_list = NULL;
100 100
@@ -138,7 +138,7 @@ static dev_link_t *ide_attach(void)
138 ret = pcmcia_register_client(&link->handle, &client_reg); 138 ret = pcmcia_register_client(&link->handle, &client_reg);
139 if (ret != CS_SUCCESS) { 139 if (ret != CS_SUCCESS) {
140 cs_error(link->handle, RegisterClient, ret); 140 cs_error(link->handle, RegisterClient, ret);
141 ide_detach(link); 141 ide_detach(link->handle);
142 return NULL; 142 return NULL;
143 } 143 }
144 144
@@ -154,10 +154,10 @@ static dev_link_t *ide_attach(void)
154 154
155======================================================================*/ 155======================================================================*/
156 156
157static void ide_detach(dev_link_t *link) 157static void ide_detach(struct pcmcia_device *p_dev)
158{ 158{
159 dev_link_t *link = dev_to_instance(p_dev);
159 dev_link_t **linkp; 160 dev_link_t **linkp;
160 int ret;
161 161
162 DEBUG(0, "ide_detach(0x%p)\n", link); 162 DEBUG(0, "ide_detach(0x%p)\n", link);
163 163
@@ -170,12 +170,6 @@ static void ide_detach(dev_link_t *link)
170 if (link->state & DEV_CONFIG) 170 if (link->state & DEV_CONFIG)
171 ide_release(link); 171 ide_release(link);
172 172
173 if (link->handle) {
174 ret = pcmcia_deregister_client(link->handle);
175 if (ret != CS_SUCCESS)
176 cs_error(link->handle, DeregisterClient, ret);
177 }
178
179 /* Unlink, free device structure */ 173 /* Unlink, free device structure */
180 *linkp = link->next; 174 *linkp = link->next;
181 kfree(link->priv); 175 kfree(link->priv);
@@ -445,11 +439,6 @@ int ide_event(event_t event, int priority,
445 DEBUG(1, "ide_event(0x%06x)\n", event); 439 DEBUG(1, "ide_event(0x%06x)\n", event);
446 440
447 switch (event) { 441 switch (event) {
448 case CS_EVENT_CARD_REMOVAL:
449 link->state &= ~DEV_PRESENT;
450 if (link->state & DEV_CONFIG)
451 ide_release(link);
452 break;
453 case CS_EVENT_CARD_INSERTION: 442 case CS_EVENT_CARD_INSERTION:
454 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 443 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
455 ide_config(link); 444 ide_config(link);
@@ -504,7 +493,7 @@ static struct pcmcia_driver ide_cs_driver = {
504 }, 493 },
505 .attach = ide_attach, 494 .attach = ide_attach,
506 .event = ide_event, 495 .event = ide_event,
507 .detach = ide_detach, 496 .remove = ide_detach,
508 .id_table = ide_ids, 497 .id_table = ide_ids,
509 .suspend = ide_suspend, 498 .suspend = ide_suspend,
510 .resume = ide_resume, 499 .resume = ide_resume,