aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/ibmtr_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 04:45:09 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:57 -0500
commitfd238232cd0ff4840ae6946bb338502154096d88 (patch)
treed20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/net/pcmcia/ibmtr_cs.c
parenta78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff)
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the same entity. The actual contents of dev_link_t will be cleaned up step by step. This patch includes a bugfix from and signed-off-by Andrew Morton. 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.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 904c5cb04e71..f4c3dd870aca 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -113,7 +113,7 @@ static void ibmtr_detach(struct pcmcia_device *p_dev);
113/*====================================================================*/ 113/*====================================================================*/
114 114
115typedef struct ibmtr_dev_t { 115typedef struct ibmtr_dev_t {
116 dev_link_t link; 116 struct pcmcia_device *p_dev;
117 struct net_device *dev; 117 struct net_device *dev;
118 dev_node_t node; 118 dev_node_t node;
119 window_handle_t sram_win_handle; 119 window_handle_t sram_win_handle;
@@ -141,8 +141,8 @@ static struct ethtool_ops netdev_ethtool_ops = {
141static int ibmtr_attach(struct pcmcia_device *p_dev) 141static int ibmtr_attach(struct pcmcia_device *p_dev)
142{ 142{
143 ibmtr_dev_t *info; 143 ibmtr_dev_t *info;
144 dev_link_t *link;
145 struct net_device *dev; 144 struct net_device *dev;
145 dev_link_t *link = dev_to_instance(p_dev);
146 146
147 DEBUG(0, "ibmtr_attach()\n"); 147 DEBUG(0, "ibmtr_attach()\n");
148 148
@@ -156,7 +156,7 @@ static int ibmtr_attach(struct pcmcia_device *p_dev)
156 return -ENOMEM; 156 return -ENOMEM;
157 } 157 }
158 158
159 link = &info->link; 159 info->p_dev = p_dev;
160 link->priv = info; 160 link->priv = info;
161 info->ti = netdev_priv(dev); 161 info->ti = netdev_priv(dev);
162 162
@@ -171,11 +171,8 @@ static int ibmtr_attach(struct pcmcia_device *p_dev)
171 link->conf.Present = PRESENT_OPTION; 171 link->conf.Present = PRESENT_OPTION;
172 172
173 link->irq.Instance = info->dev = dev; 173 link->irq.Instance = info->dev = dev;
174
175 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
176 174
177 link->handle = p_dev; 175 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
178 p_dev->instance = link;
179 176
180 link->state |= DEV_PRESENT; 177 link->state |= DEV_PRESENT;
181 ibmtr_config(link); 178 ibmtr_config(link);
@@ -200,7 +197,7 @@ static void ibmtr_detach(struct pcmcia_device *p_dev)
200 197
201 DEBUG(0, "ibmtr_detach(0x%p)\n", link); 198 DEBUG(0, "ibmtr_detach(0x%p)\n", link);
202 199
203 if (link->dev) 200 if (link->dev_node)
204 unregister_netdev(dev); 201 unregister_netdev(dev);
205 202
206 { 203 {
@@ -308,14 +305,14 @@ static void ibmtr_config(dev_link_t *link)
308 Adapters Technical Reference" SC30-3585 for this info. */ 305 Adapters Technical Reference" SC30-3585 for this info. */
309 ibmtr_hw_setup(dev, mmiobase); 306 ibmtr_hw_setup(dev, mmiobase);
310 307
311 link->dev = &info->node; 308 link->dev_node = &info->node;
312 link->state &= ~DEV_CONFIG_PENDING; 309 link->state &= ~DEV_CONFIG_PENDING;
313 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 310 SET_NETDEV_DEV(dev, &handle_to_dev(handle));
314 311
315 i = ibmtr_probe_card(dev); 312 i = ibmtr_probe_card(dev);
316 if (i != 0) { 313 if (i != 0) {
317 printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); 314 printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n");
318 link->dev = NULL; 315 link->dev_node = NULL;
319 goto failed; 316 goto failed;
320 } 317 }
321 318