aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/fmvj18x_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/net/pcmcia/fmvj18x_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/net/pcmcia/fmvj18x_cs.c')
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 388ecade13de..560d4ee22803 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -91,7 +91,7 @@ static void fmvj18x_release(dev_link_t *link);
91static int fmvj18x_event(event_t event, int priority, 91static int fmvj18x_event(event_t event, int priority,
92 event_callback_args_t *args); 92 event_callback_args_t *args);
93static dev_link_t *fmvj18x_attach(void); 93static dev_link_t *fmvj18x_attach(void);
94static void fmvj18x_detach(dev_link_t *); 94static void fmvj18x_detach(struct pcmcia_device *p_dev);
95 95
96/* 96/*
97 LAN controller(MBH86960A) specific routines 97 LAN controller(MBH86960A) specific routines
@@ -291,7 +291,7 @@ static dev_link_t *fmvj18x_attach(void)
291 ret = pcmcia_register_client(&link->handle, &client_reg); 291 ret = pcmcia_register_client(&link->handle, &client_reg);
292 if (ret != 0) { 292 if (ret != 0) {
293 cs_error(link->handle, RegisterClient, ret); 293 cs_error(link->handle, RegisterClient, ret);
294 fmvj18x_detach(link); 294 fmvj18x_detach(link->handle);
295 return NULL; 295 return NULL;
296 } 296 }
297 297
@@ -300,8 +300,9 @@ static dev_link_t *fmvj18x_attach(void)
300 300
301/*====================================================================*/ 301/*====================================================================*/
302 302
303static void fmvj18x_detach(dev_link_t *link) 303static void fmvj18x_detach(struct pcmcia_device *p_dev)
304{ 304{
305 dev_link_t *link = dev_to_instance(p_dev);
305 struct net_device *dev = link->priv; 306 struct net_device *dev = link->priv;
306 dev_link_t **linkp; 307 dev_link_t **linkp;
307 308
@@ -319,10 +320,6 @@ static void fmvj18x_detach(dev_link_t *link)
319 if (link->state & DEV_CONFIG) 320 if (link->state & DEV_CONFIG)
320 fmvj18x_release(link); 321 fmvj18x_release(link);
321 322
322 /* Break the link with Card Services */
323 if (link->handle)
324 pcmcia_deregister_client(link->handle);
325
326 /* Unlink device structure, free pieces */ 323 /* Unlink device structure, free pieces */
327 *linkp = link->next; 324 *linkp = link->next;
328 free_netdev(dev); 325 free_netdev(dev);
@@ -752,16 +749,10 @@ static int fmvj18x_event(event_t event, int priority,
752 event_callback_args_t *args) 749 event_callback_args_t *args)
753{ 750{
754 dev_link_t *link = args->client_data; 751 dev_link_t *link = args->client_data;
755 struct net_device *dev = link->priv;
756 752
757 DEBUG(1, "fmvj18x_event(0x%06x)\n", event); 753 DEBUG(1, "fmvj18x_event(0x%06x)\n", event);
758 754
759 switch (event) { 755 switch (event) {
760 case CS_EVENT_CARD_REMOVAL:
761 link->state &= ~DEV_PRESENT;
762 if (link->state & DEV_CONFIG)
763 netif_device_detach(dev);
764 break;
765 case CS_EVENT_CARD_INSERTION: 756 case CS_EVENT_CARD_INSERTION:
766 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 757 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
767 fmvj18x_config(link); 758 fmvj18x_config(link);
@@ -802,7 +793,7 @@ static struct pcmcia_driver fmvj18x_cs_driver = {
802 }, 793 },
803 .attach = fmvj18x_attach, 794 .attach = fmvj18x_attach,
804 .event = fmvj18x_event, 795 .event = fmvj18x_event,
805 .detach = fmvj18x_detach, 796 .remove = fmvj18x_detach,
806 .id_table = fmvj18x_ids, 797 .id_table = fmvj18x_ids,
807 .suspend = fmvj18x_suspend, 798 .suspend = fmvj18x_suspend,
808 .resume = fmvj18x_resume, 799 .resume = fmvj18x_resume,