diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 17:52:29 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 17:52:29 -0800 |
| commit | baf4e2cf9dddbc39fdb7dde6e3f9ebc107b67b78 (patch) | |
| tree | b11a69e0dda62c40b231ae748138ce7908d9cade /drivers/net/sunbmac.c | |
| parent | 6805de5d7eb97f6e905b152b2fc1ee03fd0fb3aa (diff) | |
v2.4.0.9 -> v2.4.0.10
- got a few too-new R128 #defines in the Radeon merge. Fix.
- tulip driver update from Jeff Garzik
- more cpq and DAC elevator fixes from Jens. Looks good.
- Petr Vandrovec: nicer ncpfs behaviour
- Andy Grover: APCI update
- Cort Dougan: PPC update
- David Miller: sparc updates
- David Miller: networking updates
- Neil Brown: RAID5 fixes
Diffstat (limited to 'drivers/net/sunbmac.c')
| -rw-r--r-- | drivers/net/sunbmac.c | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c index 3036684f9835..2535485992ad 100644 --- a/drivers/net/sunbmac.c +++ b/drivers/net/sunbmac.c @@ -1,12 +1,9 @@ -/* $Id: sunbmac.c,v 1.21 2000/10/22 16:08:38 davem Exp $ +/* $Id: sunbmac.c,v 1.23 2001/01/20 03:36:40 davem Exp $ * sunbmac.c: Driver for Sparc BigMAC 100baseT ethernet adapters. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com) */ -static char *version = - "sunbmac.c:v1.9 11/Sep/99 David S. Miller (davem@redhat.com)\n"; - #include <linux/module.h> #include <linux/kernel.h> @@ -41,6 +38,9 @@ static char *version = #include "sunbmac.h" +static char version[] __initdata = + "sunbmac.c:v1.9 11/Sep/99 David S. Miller (davem@redhat.com)\n"; + #undef DEBUG_PROBE #undef DEBUG_TX #undef DEBUG_IRQ @@ -1051,10 +1051,10 @@ static void bigmac_set_multicast(struct net_device *dev) static int __init bigmac_ether_init(struct net_device *dev, struct sbus_dev *qec_sdev) { - static int version_printed = 0; - struct bigmac *bp = 0; + static int version_printed; + struct bigmac *bp; u8 bsizes, bsizes_more; - int i, res = ENOMEM; + int i; /* Get a new device struct for this interface. */ dev = init_etherdev(0, sizeof(struct bigmac)); @@ -1062,6 +1062,9 @@ static int __init bigmac_ether_init(struct net_device *dev, struct sbus_dev *qec if (version_printed++ == 0) printk(KERN_INFO "%s", version); + if (!dev) + return -ENOMEM; + /* Report what we have found to the user. */ printk(KERN_INFO "%s: BigMAC 100baseT Ethernet ", dev->name); dev->base_addr = (long) qec_sdev; @@ -1077,9 +1080,6 @@ static int __init bigmac_ether_init(struct net_device *dev, struct sbus_dev *qec spin_lock_init(&bp->lock); - /* All further failures we find return this. */ - res = ENODEV; - /* Verify the registers we expect, are actually there. */ if ((bp->bigmac_sdev->num_registers != 3) || (bp->qec_sdev->num_registers != 2)) { @@ -1205,28 +1205,25 @@ static int __init bigmac_ether_init(struct net_device *dev, struct sbus_dev *qec fail_and_cleanup: /* Something went wrong, undo whatever we did so far. */ - if (bp) { - /* Free register mappings if any. */ - if (bp->gregs) - sbus_iounmap(bp->gregs, GLOB_REG_SIZE); - if (bp->creg) - sbus_iounmap(bp->creg, CREG_REG_SIZE); - if (bp->bregs) - sbus_iounmap(bp->bregs, BMAC_REG_SIZE); - if (bp->tregs) - sbus_iounmap(bp->tregs, TCVR_REG_SIZE); - - if (bp->bmac_block) - sbus_free_consistent(bp->bigmac_sdev, - PAGE_SIZE, - bp->bmac_block, - bp->bblock_dvma); - - /* Free the BigMAC softc. */ - kfree(bp); - dev->priv = 0; - } - return res; /* Return error code. */ + /* Free register mappings if any. */ + if (bp->gregs) + sbus_iounmap(bp->gregs, GLOB_REG_SIZE); + if (bp->creg) + sbus_iounmap(bp->creg, CREG_REG_SIZE); + if (bp->bregs) + sbus_iounmap(bp->bregs, BMAC_REG_SIZE); + if (bp->tregs) + sbus_iounmap(bp->tregs, TCVR_REG_SIZE); + + if (bp->bmac_block) + sbus_free_consistent(bp->bigmac_sdev, + PAGE_SIZE, + bp->bmac_block, + bp->bblock_dvma); + + unregister_netdev(dev); + kfree(dev); + return -ENODEV; } /* QEC can be the parent of either QuadEthernet or |
