summaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 21:23:14 +0100
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-06 00:03:10 +0100
commitcc3b4866bee996c922e875b8c8efe9f0d8803aae (patch)
tree6632837b6986f33566f75ed971cecbdc210e3201 /drivers/ide
parent8e9e793d68fcda6cc84c18cedf85ca0f91d801a8 (diff)
downloadblackbird-op-linux-cc3b4866bee996c922e875b8c8efe9f0d8803aae.tar.gz
blackbird-op-linux-cc3b4866bee996c922e875b8c8efe9f0d8803aae.zip
[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,
static dev_info_t dev_info = "ide-cs";
static dev_link_t *ide_attach(void);
-static void ide_detach(dev_link_t *);
+static void ide_detach(struct pcmcia_device *p_dev);
static dev_link_t *dev_list = NULL;
@@ -138,7 +138,7 @@ static dev_link_t *ide_attach(void)
ret = pcmcia_register_client(&link->handle, &client_reg);
if (ret != CS_SUCCESS) {
cs_error(link->handle, RegisterClient, ret);
- ide_detach(link);
+ ide_detach(link->handle);
return NULL;
}
@@ -154,10 +154,10 @@ static dev_link_t *ide_attach(void)
======================================================================*/
-static void ide_detach(dev_link_t *link)
+static void ide_detach(struct pcmcia_device *p_dev)
{
+ dev_link_t *link = dev_to_instance(p_dev);
dev_link_t **linkp;
- int ret;
DEBUG(0, "ide_detach(0x%p)\n", link);
@@ -170,12 +170,6 @@ static void ide_detach(dev_link_t *link)
if (link->state & DEV_CONFIG)
ide_release(link);
- if (link->handle) {
- ret = pcmcia_deregister_client(link->handle);
- if (ret != CS_SUCCESS)
- cs_error(link->handle, DeregisterClient, ret);
- }
-
/* Unlink, free device structure */
*linkp = link->next;
kfree(link->priv);
@@ -445,11 +439,6 @@ int ide_event(event_t event, int priority,
DEBUG(1, "ide_event(0x%06x)\n", event);
switch (event) {
- case CS_EVENT_CARD_REMOVAL:
- link->state &= ~DEV_PRESENT;
- if (link->state & DEV_CONFIG)
- ide_release(link);
- break;
case CS_EVENT_CARD_INSERTION:
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
ide_config(link);
@@ -504,7 +493,7 @@ static struct pcmcia_driver ide_cs_driver = {
},
.attach = ide_attach,
.event = ide_event,
- .detach = ide_detach,
+ .remove = ide_detach,
.id_table = ide_ids,
.suspend = ide_suspend,
.resume = ide_resume,
OpenPOWER on IntegriCloud