summaryrefslogtreecommitdiff
path: root/drivers/net/3c515.c
diff options
context:
space:
mode:
author <herbert@gondor.apana.org.au>2005-05-12 20:11:55 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-05-12 20:11:55 -0400
commitb1fc5505e0dbcc3fd7c75bfe6bee39ec50080963 (patch)
treef8c0bb679dc8e72816e16820c3dbcccf924097eb /drivers/net/3c515.c
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
[netdrvr] Fix register_netdev() races in older ISA net drivers
Diffstat (limited to 'drivers/net/3c515.c')
-rw-r--r--drivers/net/3c515.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index c4cf4fcd1344..d272ea36a578 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -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);
@@ -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);
@@ -558,8 +557,7 @@ no_pnp:
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);
@@ -568,7 +566,7 @@ no_pnp:
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);
@@ -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);
}