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

[ACENIC]: Convert to alloc_etherdev.

parent ead822b8
...@@ -642,8 +642,7 @@ int __devinit acenic_probe (ACE_PROBE_ARG) ...@@ -642,8 +642,7 @@ int __devinit acenic_probe (ACE_PROBE_ARG)
(pdev->device == PCI_DEVICE_ID_SGI_ACENIC))) (pdev->device == PCI_DEVICE_ID_SGI_ACENIC)))
continue; continue;
dev = init_etherdev(NULL, sizeof(struct ace_private)); dev = alloc_etherdev(sizeof(struct ace_private));
if (dev == NULL) { if (dev == NULL) {
printk(KERN_ERR "acenic: Unable to allocate " printk(KERN_ERR "acenic: Unable to allocate "
"net_device structure!\n"); "net_device structure!\n");
...@@ -653,13 +652,6 @@ int __devinit acenic_probe (ACE_PROBE_ARG) ...@@ -653,13 +652,6 @@ int __devinit acenic_probe (ACE_PROBE_ARG)
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
if (!dev->priv)
dev->priv = kmalloc(sizeof(*ap), GFP_KERNEL);
if (!dev->priv) {
printk(KERN_ERR "acenic: Unable to allocate memory\n");
return -ENOMEM;
}
ap = dev->priv; ap = dev->priv;
ap->pdev = pdev; ap->pdev = pdev;
...@@ -739,6 +731,12 @@ int __devinit acenic_probe (ACE_PROBE_ARG) ...@@ -739,6 +731,12 @@ int __devinit acenic_probe (ACE_PROBE_ARG)
break; break;
} }
if (register_netdev(dev)) {
printk(KERN_ERR "acenic: device registration failed\n");
kfree(dev);
continue;
}
switch(pdev->vendor) { switch(pdev->vendor) {
case PCI_VENDOR_ID_ALTEON: case PCI_VENDOR_ID_ALTEON:
if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) { if (pdev->device == PCI_DEVICE_ID_FARALLON_PN9100T) {
......
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