diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-11-14 15:25:35 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-05 18:03:20 -0500 |
commit | b463581154f3f3eecda27cae60df813fefcd84d3 (patch) | |
tree | 5e5b0f7a32b0727b64e52b9b2649897e6c841074 /drivers/net/pcmcia/ibmtr_cs.c | |
parent | f3990715589d378a2d3aa9b8accd78bb4a2378b7 (diff) |
[PATCH] pcmcia: remove dev_list from drivers
The linked list of devices managed by each PCMCIA driver is, in very most
cases, unused. Therefore, remove it from many drivers.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/ibmtr_cs.c')
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 961294983354..90da35d1f4a5 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -116,8 +116,6 @@ static dev_info_t dev_info = "ibmtr_cs"; | |||
116 | static dev_link_t *ibmtr_attach(void); | 116 | static dev_link_t *ibmtr_attach(void); |
117 | static void ibmtr_detach(struct pcmcia_device *p_dev); | 117 | static void ibmtr_detach(struct pcmcia_device *p_dev); |
118 | 118 | ||
119 | static dev_link_t *dev_list; | ||
120 | |||
121 | /*====================================================================*/ | 119 | /*====================================================================*/ |
122 | 120 | ||
123 | typedef struct ibmtr_dev_t { | 121 | typedef struct ibmtr_dev_t { |
@@ -186,8 +184,7 @@ static dev_link_t *ibmtr_attach(void) | |||
186 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); | 184 | SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); |
187 | 185 | ||
188 | /* Register with Card Services */ | 186 | /* Register with Card Services */ |
189 | link->next = dev_list; | 187 | link->next = NULL; |
190 | dev_list = link; | ||
191 | client_reg.dev_info = &dev_info; | 188 | client_reg.dev_info = &dev_info; |
192 | client_reg.Version = 0x0210; | 189 | client_reg.Version = 0x0210; |
193 | client_reg.event_callback_args.client_data = link; | 190 | client_reg.event_callback_args.client_data = link; |
@@ -219,19 +216,10 @@ static void ibmtr_detach(struct pcmcia_device *p_dev) | |||
219 | { | 216 | { |
220 | dev_link_t *link = dev_to_instance(p_dev); | 217 | dev_link_t *link = dev_to_instance(p_dev); |
221 | struct ibmtr_dev_t *info = link->priv; | 218 | struct ibmtr_dev_t *info = link->priv; |
222 | dev_link_t **linkp; | 219 | struct net_device *dev = info->dev; |
223 | struct net_device *dev; | ||
224 | 220 | ||
225 | DEBUG(0, "ibmtr_detach(0x%p)\n", link); | 221 | DEBUG(0, "ibmtr_detach(0x%p)\n", link); |
226 | 222 | ||
227 | /* Locate device structure */ | ||
228 | for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) | ||
229 | if (*linkp == link) break; | ||
230 | if (*linkp == NULL) | ||
231 | return; | ||
232 | |||
233 | dev = info->dev; | ||
234 | |||
235 | if (link->dev) | 223 | if (link->dev) |
236 | unregister_netdev(dev); | 224 | unregister_netdev(dev); |
237 | 225 | ||
@@ -242,10 +230,8 @@ static void ibmtr_detach(struct pcmcia_device *p_dev) | |||
242 | if (link->state & DEV_CONFIG) | 230 | if (link->state & DEV_CONFIG) |
243 | ibmtr_release(link); | 231 | ibmtr_release(link); |
244 | 232 | ||
245 | /* Unlink device structure, free bits */ | ||
246 | *linkp = link->next; | ||
247 | free_netdev(dev); | 233 | free_netdev(dev); |
248 | kfree(info); | 234 | kfree(info); |
249 | } /* ibmtr_detach */ | 235 | } /* ibmtr_detach */ |
250 | 236 | ||
251 | /*====================================================================== | 237 | /*====================================================================== |
@@ -530,7 +516,6 @@ static int __init init_ibmtr_cs(void) | |||
530 | static void __exit exit_ibmtr_cs(void) | 516 | static void __exit exit_ibmtr_cs(void) |
531 | { | 517 | { |
532 | pcmcia_unregister_driver(&ibmtr_cs_driver); | 518 | pcmcia_unregister_driver(&ibmtr_cs_driver); |
533 | BUG_ON(dev_list != NULL); | ||
534 | } | 519 | } |
535 | 520 | ||
536 | module_init(init_ibmtr_cs); | 521 | module_init(init_ibmtr_cs); |