diff options
Diffstat (limited to 'drivers/net/pcmcia/3c589_cs.c')
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 09b96c76216e..3516c02b9c89 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -166,8 +166,6 @@ static dev_info_t dev_info = "3c589_cs"; | |||
166 | static dev_link_t *tc589_attach(void); | 166 | static dev_link_t *tc589_attach(void); |
167 | static void tc589_detach(struct pcmcia_device *p_dev); | 167 | static void tc589_detach(struct pcmcia_device *p_dev); |
168 | 168 | ||
169 | static dev_link_t *dev_list; | ||
170 | |||
171 | /*====================================================================== | 169 | /*====================================================================== |
172 | 170 | ||
173 | tc589_attach() creates an "instance" of the driver, allocating | 171 | tc589_attach() creates an "instance" of the driver, allocating |
@@ -222,8 +220,7 @@ static dev_link_t *tc589_attach(void) | |||
222 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 220 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
223 | 221 | ||
224 | /* Register with Card Services */ | 222 | /* Register with Card Services */ |
225 | link->next = dev_list; | 223 | link->next = NULL; |
226 | dev_list = link; | ||
227 | client_reg.dev_info = &dev_info; | 224 | client_reg.dev_info = &dev_info; |
228 | client_reg.Version = 0x0210; | 225 | client_reg.Version = 0x0210; |
229 | client_reg.event_callback_args.client_data = link; | 226 | client_reg.event_callback_args.client_data = link; |
@@ -250,15 +247,8 @@ static void tc589_detach(struct pcmcia_device *p_dev) | |||
250 | { | 247 | { |
251 | dev_link_t *link = dev_to_instance(p_dev); | 248 | dev_link_t *link = dev_to_instance(p_dev); |
252 | struct net_device *dev = link->priv; | 249 | struct net_device *dev = link->priv; |
253 | dev_link_t **linkp; | 250 | |
254 | |||
255 | DEBUG(0, "3c589_detach(0x%p)\n", link); | 251 | DEBUG(0, "3c589_detach(0x%p)\n", link); |
256 | |||
257 | /* Locate device structure */ | ||
258 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
259 | if (*linkp == link) break; | ||
260 | if (*linkp == NULL) | ||
261 | return; | ||
262 | 252 | ||
263 | if (link->dev) | 253 | if (link->dev) |
264 | unregister_netdev(dev); | 254 | unregister_netdev(dev); |
@@ -266,8 +256,6 @@ static void tc589_detach(struct pcmcia_device *p_dev) | |||
266 | if (link->state & DEV_CONFIG) | 256 | if (link->state & DEV_CONFIG) |
267 | tc589_release(link); | 257 | tc589_release(link); |
268 | 258 | ||
269 | /* Unlink device structure, free bits */ | ||
270 | *linkp = link->next; | ||
271 | free_netdev(dev); | 259 | free_netdev(dev); |
272 | } /* tc589_detach */ | 260 | } /* tc589_detach */ |
273 | 261 | ||
@@ -1085,7 +1073,6 @@ static int __init init_tc589(void) | |||
1085 | static void __exit exit_tc589(void) | 1073 | static void __exit exit_tc589(void) |
1086 | { | 1074 | { |
1087 | pcmcia_unregister_driver(&tc589_driver); | 1075 | pcmcia_unregister_driver(&tc589_driver); |
1088 | BUG_ON(dev_list != NULL); | ||
1089 | } | 1076 | } |
1090 | 1077 | ||
1091 | module_init(init_tc589); | 1078 | module_init(init_tc589); |