Commit be89883e authored by David S. Miller's avatar David S. Miller Committed by Stephen Hemminger

[NET]: Convert sunbmac away from init_etherdev.

parent ca3d0fae
...@@ -1072,7 +1072,7 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev) ...@@ -1072,7 +1072,7 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev)
int i; int i;
/* Get a new device struct for this interface. */ /* Get a new device struct for this interface. */
dev = init_etherdev(NULL, sizeof(struct bigmac)); dev = alloc_etherdev(sizeof(struct bigmac));
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
...@@ -1080,13 +1080,9 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev) ...@@ -1080,13 +1080,9 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev)
if (version_printed++ == 0) if (version_printed++ == 0)
printk(KERN_INFO "%s", version); printk(KERN_INFO "%s", version);
/* Report what we have found to the user. */
printk(KERN_INFO "%s: BigMAC 100baseT Ethernet ", dev->name);
dev->base_addr = (long) qec_sdev; dev->base_addr = (long) qec_sdev;
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
printk("%2.2x%c", dev->dev_addr[i] = idprom->id_ethaddr[i], dev->dev_addr[i] = idprom->id_ethaddr[i];
i == 5 ? ' ' : ':');
printk("\n");
/* Setup softc, with backpointers to QEC and BigMAC SBUS device structs. */ /* Setup softc, with backpointers to QEC and BigMAC SBUS device structs. */
bp = dev->priv; bp = dev->priv;
...@@ -1210,12 +1206,23 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev) ...@@ -1210,12 +1206,23 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev)
dev->irq = bp->bigmac_sdev->irqs[0]; dev->irq = bp->bigmac_sdev->irqs[0];
dev->dma = 0; dev->dma = 0;
if (register_netdev(dev)) {
printk(KERN_ERR "BIGMAC: Cannot register device.\n");
goto fail_and_cleanup;
}
/* Put us into the list of instances attached for later driver /* Put us into the list of instances attached for later driver
* exit. * exit.
*/ */
bp->next_module = root_bigmac_dev; bp->next_module = root_bigmac_dev;
root_bigmac_dev = bp; root_bigmac_dev = bp;
printk(KERN_INFO "%s: BigMAC 100baseT Ethernet ", dev->name);
for (i = 0; i < 6; i++)
printk("%2.2x%c", dev->dev_addr[i],
i == 5 ? ' ' : ':');
printk("\n");
return 0; return 0;
fail_and_cleanup: fail_and_cleanup:
...@@ -1237,8 +1244,9 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev) ...@@ -1237,8 +1244,9 @@ static int __init bigmac_ether_init(struct sbus_dev *qec_sdev)
bp->bblock_dvma); bp->bblock_dvma);
unregister_netdev(dev); unregister_netdev(dev);
/* This also frees the co-located 'dev->priv' */ /* This also frees the co-located 'dev->priv' */
kfree(dev); free_netdev(dev);
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment