Skip to content

Commit

Permalink
Merge /spare/repo/netdev-2.6/ branch 'register-netdev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Garzik authored and Jeff Garzik committed Jun 26, 2005
2 parents 97f568d + aef7b83 commit e8c0eee
Show file tree
Hide file tree
Showing 21 changed files with 156 additions and 228 deletions.
16 changes: 6 additions & 10 deletions drivers/net/3c503.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ struct net_device * __init el2_probe(int unit)
err = do_el2_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);
Expand Down Expand Up @@ -356,6 +351,10 @@ el2_probe1(struct net_device *dev, int ioaddr)
dev->poll_controller = ei_poll;
#endif

retval = register_netdev(dev);
if (retval)
goto out1;

if (dev->mem_start)
printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
dev->name, ei_status.name, (wordlength+1)<<3,
Expand Down Expand Up @@ -715,11 +714,8 @@ init_module(void)
dev->base_addr = io[this_dev];
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
if (do_el2_probe(dev) == 0) {
if (register_netdev(dev) == 0) {
dev_el2[found++] = dev;
continue;
}
cleanup_card(dev);
dev_el2[found++] = dev;
continue;
}
free_netdev(dev);
printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]);
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/3c515.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static int nopnp;
#endif /* __ISAPNP__ */

static struct net_device *corkscrew_scan(int unit);
static void corkscrew_setup(struct net_device *dev, int ioaddr,
static int corkscrew_setup(struct net_device *dev, int ioaddr,
struct pnp_dev *idev, int card_number);
static int corkscrew_open(struct net_device *dev);
static void corkscrew_timer(unsigned long arg);
Expand Down Expand Up @@ -539,10 +539,9 @@ static struct net_device *corkscrew_scan(int unit)
printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n",
inl(ioaddr + 0x2002), inw(ioaddr + 0x2000));
/* irq = inw(ioaddr + 0x2002) & 15; */ /* Use the irq from isapnp */
corkscrew_setup(dev, ioaddr, idev, cards_found++);
SET_NETDEV_DEV(dev, &idev->dev);
pnp_cards++;
err = register_netdev(dev);
err = corkscrew_setup(dev, ioaddr, idev, cards_found++);
if (!err)
return dev;
cleanup_card(dev);
Expand All @@ -558,8 +557,7 @@ static struct net_device *corkscrew_scan(int unit)

printk(KERN_INFO "3c515 Resource configuration register %#4.4x, DCR %4.4x.\n",
inl(ioaddr + 0x2002), inw(ioaddr + 0x2000));
corkscrew_setup(dev, ioaddr, NULL, cards_found++);
err = register_netdev(dev);
err = corkscrew_setup(dev, ioaddr, NULL, cards_found++);
if (!err)
return dev;
cleanup_card(dev);
Expand All @@ -568,7 +566,7 @@ static struct net_device *corkscrew_scan(int unit)
return NULL;
}

static void corkscrew_setup(struct net_device *dev, int ioaddr,
static int corkscrew_setup(struct net_device *dev, int ioaddr,
struct pnp_dev *idev, int card_number)
{
struct corkscrew_private *vp = netdev_priv(dev);
Expand Down Expand Up @@ -691,6 +689,8 @@ static void corkscrew_setup(struct net_device *dev, int ioaddr,
dev->get_stats = &corkscrew_get_stats;
dev->set_multicast_list = &set_rx_mode;
dev->ethtool_ops = &netdev_ethtool_ops;

return register_netdev(dev);
}


Expand Down
18 changes: 7 additions & 11 deletions drivers/net/3c523.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,10 @@ static int __init do_elmc_probe(struct net_device *dev)
dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */
#endif

retval = register_netdev(dev);
if (retval)
goto err_out;

return 0;
err_out:
mca_set_adapter_procfn(slot, NULL, NULL);
Expand Down Expand Up @@ -600,12 +604,7 @@ struct net_device * __init elmc_probe(int unit)
err = do_elmc_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);
Expand Down Expand Up @@ -1288,12 +1287,9 @@ int init_module(void)
dev->irq=irq[this_dev];
dev->base_addr=io[this_dev];
if (do_elmc_probe(dev) == 0) {
if (register_netdev(dev) == 0) {
dev_elmc[this_dev] = dev;
found++;
continue;
}
cleanup_card(dev);
dev_elmc[this_dev] = dev;
found++;
continue;
}
free_netdev(dev);
if (io[this_dev]==0)
Expand Down
19 changes: 9 additions & 10 deletions drivers/net/ac3200.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@ struct net_device * __init ac3200_probe(int unit)
err = do_ac3200_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);
Expand Down Expand Up @@ -273,7 +268,14 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
dev->poll_controller = ei_poll;
#endif
NS8390_init(dev, 0);

retval = register_netdev(dev);
if (retval)
goto out2;
return 0;
out2:
if (ei_status.reg0)
iounmap((void *)dev->mem_start);
out1:
free_irq(dev->irq, dev);
out:
Expand Down Expand Up @@ -392,11 +394,8 @@ init_module(void)
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev]; /* Currently ignored by driver */
if (do_ac3200_probe(dev) == 0) {
if (register_netdev(dev) == 0) {
dev_ac32[found++] = dev;
continue;
}
cleanup_card(dev);
dev_ac32[found++] = dev;
continue;
}
free_netdev(dev);
printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]);
Expand Down
19 changes: 6 additions & 13 deletions drivers/net/cs89x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,7 @@ struct net_device * __init cs89x0_probe(int unit)
}
if (err)
goto out;
err = register_netdev(dev);
if (err)
goto out1;
return dev;
out1:
outw(PP_ChipID, dev->base_addr + ADD_PORT);
release_region(dev->base_addr, NETCARD_IO_EXTENT);
out:
free_netdev(dev);
printk(KERN_WARNING "cs89x0: no cs8900 or cs8920 detected. Be sure to disable PnP with SETUP\n");
Expand Down Expand Up @@ -735,7 +729,13 @@ printk("PP_addr=0x%x\n", inw(ioaddr + ADD_PORT));
printk("\n");
if (net_debug)
printk("cs89x0_probe1() successful\n");

retval = register_netdev(dev);
if (retval)
goto out3;
return 0;
out3:
outw(PP_ChipID, dev->base_addr + ADD_PORT);
out2:
release_region(ioaddr & ~3, NETCARD_IO_EXTENT);
out1:
Expand Down Expand Up @@ -1831,13 +1831,6 @@ init_module(void)
if (ret)
goto out;

if (register_netdev(dev) != 0) {
printk(KERN_ERR "cs89x0.c: No card found at 0x%x\n", io);
ret = -ENXIO;
outw(PP_ChipID, dev->base_addr + ADD_PORT);
release_region(dev->base_addr, NETCARD_IO_EXTENT);
goto out;
}
dev_cs89x0 = dev;
return 0;
out:
Expand Down
15 changes: 5 additions & 10 deletions drivers/net/e2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,7 @@ struct net_device * __init e2100_probe(int unit)
err = do_e2100_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);
Expand Down Expand Up @@ -286,6 +281,9 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
#endif
NS8390_init(dev, 0);

retval = register_netdev(dev);
if (retval)
goto out;
return 0;
out:
release_region(ioaddr, E21_IO_EXTENT);
Expand Down Expand Up @@ -453,11 +451,8 @@ init_module(void)
dev->mem_start = mem[this_dev];
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
if (do_e2100_probe(dev) == 0) {
if (register_netdev(dev) == 0) {
dev_e21[found++] = dev;
continue;
}
cleanup_card(dev);
dev_e21[found++] = dev;
continue;
}
free_netdev(dev);
printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]);
Expand Down
21 changes: 10 additions & 11 deletions drivers/net/eepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,7 @@ struct net_device * __init eepro_probe(int unit)
err = do_eepro_probe(dev);
if (err)
goto out;
err = register_netdev(dev);
if (err)
goto out1;
return dev;
out1:
release_region(dev->base_addr, EEPRO_IO_EXTENT);
out:
free_netdev(dev);
return ERR_PTR(err);
Expand Down Expand Up @@ -758,6 +753,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
int i;
struct eepro_local *lp;
int ioaddr = dev->base_addr;
int err;

/* Grab the region so we can find another board if autoIRQ fails. */
if (!request_region(ioaddr, EEPRO_IO_EXTENT, DRV_NAME)) {
Expand Down Expand Up @@ -873,10 +869,16 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)

/* reset 82595 */
eepro_reset(ioaddr);

err = register_netdev(dev);
if (err)
goto err;
return 0;
exit:
err = -ENODEV;
err:
release_region(dev->base_addr, EEPRO_IO_EXTENT);
return -ENODEV;
return err;
}

/* Open/initialize the board. This is called (in the current kernel)
Expand Down Expand Up @@ -1834,11 +1836,8 @@ init_module(void)
dev->irq = irq[i];

if (do_eepro_probe(dev) == 0) {
if (register_netdev(dev) == 0) {
dev_eepro[n_eepro++] = dev;
continue;
}
release_region(dev->base_addr, EEPRO_IO_EXTENT);
dev_eepro[n_eepro++] = dev;
continue;
}
free_netdev(dev);
break;
Expand Down
12 changes: 5 additions & 7 deletions drivers/net/eexpress.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,8 @@ struct net_device * __init express_probe(int unit)
netdev_boot_setup_check(dev);

err = do_express_probe(dev);
if (!err) {
err = register_netdev(dev);
if (!err)
return dev;
}
if (!err)
return dev;
free_netdev(dev);
return ERR_PTR(err);
}
Expand Down Expand Up @@ -1205,7 +1202,8 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
dev->set_multicast_list = &eexp_set_multicast;
dev->tx_timeout = eexp_timeout;
dev->watchdog_timeo = 2*HZ;
return 0;

return register_netdev(dev);
}

/*
Expand Down Expand Up @@ -1716,7 +1714,7 @@ int init_module(void)
break;
printk(KERN_NOTICE "eexpress.c: Module autoprobe not recommended, give io=xx.\n");
}
if (do_express_probe(dev) == 0 && register_netdev(dev) == 0) {
if (do_express_probe(dev) == 0) {
dev_eexp[this_dev] = dev;
found++;
continue;
Expand Down
16 changes: 6 additions & 10 deletions drivers/net/es3210.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,7 @@ struct net_device * __init es_probe(int unit)
err = do_es_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);
Expand Down Expand Up @@ -310,6 +305,10 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
dev->poll_controller = ei_poll;
#endif
NS8390_init(dev, 0);

retval = register_netdev(dev);
if (retval)
goto out1;
return 0;
out1:
free_irq(dev->irq, dev);
Expand Down Expand Up @@ -445,11 +444,8 @@ init_module(void)
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev];
if (do_es_probe(dev) == 0) {
if (register_netdev(dev) == 0) {
dev_es3210[found++] = dev;
continue;
}
cleanup_card(dev);
dev_es3210[found++] = dev;
continue;
}
free_netdev(dev);
printk(KERN_WARNING "es3210.c: No es3210 card found (i/o = 0x%x).\n", io[this_dev]);
Expand Down
Loading

0 comments on commit e8c0eee

Please sign in to comment.