diff options
Diffstat (limited to 'drivers/net/pcmcia/ibmtr_cs.c')
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 17 |
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 | ||
115 | typedef struct ibmtr_dev_t { | 115 | typedef 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 = { | |||
141 | static int ibmtr_attach(struct pcmcia_device *p_dev) | 141 | static 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 | ||