aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/lne390.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/lne390.c')
-rw-r--r--drivers/net/lne390.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c
index 179a97c..27f0d8a 100644
--- a/drivers/net/lne390.c
+++ b/drivers/net/lne390.c
@@ -167,12 +167,7 @@ struct net_device * __init lne390_probe(int unit)
err = do_lne390_probe(dev);
if (err)
goto out;
- err = register_netdev(dev);
- if (err)
- goto out1;
return dev;
-out1:
- cleanup_card(dev);
out:
free_netdev(dev);
return ERR_PTR(err);
@@ -296,7 +291,14 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
dev->poll_controller = ei_poll;
#endif
NS8390_init(dev, 0);
+
+ ret = register_netdev(dev);
+ if (ret)
+ goto unmap;
return 0;
+unmap:
+ if (ei_status.reg0)
+ iounmap((void *)dev->mem_start);
cleanup:
free_irq(dev->irq, dev);
return ret;
@@ -426,11 +428,8 @@ int init_module(void)
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev];
if (do_lne390_probe(dev) == 0) {
- if (register_netdev(dev) == 0) {
- dev_lne[found++] = dev;
- continue;
- }
- cleanup_card(dev);
+ dev_lne[found++] = dev;
+ continue;
}
free_netdev(dev);
printk(KERN_WARNING "lne390.c: No LNE390 card found (i/o = 0x%x).\n", io[this_dev]);