diff options
Diffstat (limited to 'drivers/net/pcmcia/com20020_cs.c')
-rw-r--r-- | drivers/net/pcmcia/com20020_cs.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 21d9c9d815d1..5643f94541bc 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c | |||
@@ -122,7 +122,6 @@ static void com20020_detach(struct pcmcia_device *p_dev); | |||
122 | 122 | ||
123 | typedef struct com20020_dev_t { | 123 | typedef struct com20020_dev_t { |
124 | struct net_device *dev; | 124 | struct net_device *dev; |
125 | dev_node_t node; | ||
126 | } com20020_dev_t; | 125 | } com20020_dev_t; |
127 | 126 | ||
128 | /*====================================================================== | 127 | /*====================================================================== |
@@ -163,7 +162,6 @@ static int com20020_probe(struct pcmcia_device *p_dev) | |||
163 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 162 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; |
164 | p_dev->io.NumPorts1 = 16; | 163 | p_dev->io.NumPorts1 = 16; |
165 | p_dev->io.IOAddrLines = 16; | 164 | p_dev->io.IOAddrLines = 16; |
166 | p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | ||
167 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; | 165 | p_dev->conf.Attributes = CONF_ENABLE_IRQ; |
168 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 166 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
169 | 167 | ||
@@ -196,18 +194,16 @@ static void com20020_detach(struct pcmcia_device *link) | |||
196 | 194 | ||
197 | dev_dbg(&link->dev, "com20020_detach\n"); | 195 | dev_dbg(&link->dev, "com20020_detach\n"); |
198 | 196 | ||
199 | if (link->dev_node) { | 197 | dev_dbg(&link->dev, "unregister...\n"); |
200 | dev_dbg(&link->dev, "unregister...\n"); | ||
201 | 198 | ||
202 | unregister_netdev(dev); | 199 | unregister_netdev(dev); |
203 | 200 | ||
204 | /* | 201 | /* |
205 | * this is necessary because we register our IRQ separately | 202 | * this is necessary because we register our IRQ separately |
206 | * from card services. | 203 | * from card services. |
207 | */ | 204 | */ |
208 | if (dev->irq) | 205 | if (dev->irq) |
209 | free_irq(dev->irq, dev); | 206 | free_irq(dev->irq, dev); |
210 | } | ||
211 | 207 | ||
212 | com20020_release(link); | 208 | com20020_release(link); |
213 | 209 | ||
@@ -275,15 +271,14 @@ static int com20020_config(struct pcmcia_device *link) | |||
275 | dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); | 271 | dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); |
276 | 272 | ||
277 | dev_dbg(&link->dev, "request IRQ %d\n", | 273 | dev_dbg(&link->dev, "request IRQ %d\n", |
278 | link->irq.AssignedIRQ); | 274 | link->irq); |
279 | i = pcmcia_request_irq(link, &link->irq); | 275 | if (!link->irq) |
280 | if (i != 0) | ||
281 | { | 276 | { |
282 | dev_dbg(&link->dev, "requestIRQ failed totally!\n"); | 277 | dev_dbg(&link->dev, "requestIRQ failed totally!\n"); |
283 | goto failed; | 278 | goto failed; |
284 | } | 279 | } |
285 | 280 | ||
286 | dev->irq = link->irq.AssignedIRQ; | 281 | dev->irq = link->irq; |
287 | 282 | ||
288 | ret = pcmcia_request_configuration(link, &link->conf); | 283 | ret = pcmcia_request_configuration(link, &link->conf); |
289 | if (ret) | 284 | if (ret) |
@@ -299,7 +294,6 @@ static int com20020_config(struct pcmcia_device *link) | |||
299 | lp->card_name = "PCMCIA COM20020"; | 294 | lp->card_name = "PCMCIA COM20020"; |
300 | lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ | 295 | lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ |
301 | 296 | ||
302 | link->dev_node = &info->node; | ||
303 | SET_NETDEV_DEV(dev, &link->dev); | 297 | SET_NETDEV_DEV(dev, &link->dev); |
304 | 298 | ||
305 | i = com20020_found(dev, 0); /* calls register_netdev */ | 299 | i = com20020_found(dev, 0); /* calls register_netdev */ |
@@ -307,12 +301,9 @@ static int com20020_config(struct pcmcia_device *link) | |||
307 | if (i != 0) { | 301 | if (i != 0) { |
308 | dev_printk(KERN_NOTICE, &link->dev, | 302 | dev_printk(KERN_NOTICE, &link->dev, |
309 | "com20020_cs: com20020_found() failed\n"); | 303 | "com20020_cs: com20020_found() failed\n"); |
310 | link->dev_node = NULL; | ||
311 | goto failed; | 304 | goto failed; |
312 | } | 305 | } |
313 | 306 | ||
314 | strcpy(info->node.dev_name, dev->name); | ||
315 | |||
316 | dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", | 307 | dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", |
317 | dev->name, dev->base_addr, dev->irq); | 308 | dev->name, dev->base_addr, dev->irq); |
318 | return 0; | 309 | return 0; |