aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/8139too.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/8139too.c')
-rw-r--r--drivers/net/8139too.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 445a479db79d..67bbf4f25bea 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -741,8 +741,7 @@ static void rtl8139_chip_reset (void __iomem *ioaddr)
741} 741}
742 742
743 743
744static int __devinit rtl8139_init_board (struct pci_dev *pdev, 744static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev)
745 struct net_device **dev_out)
746{ 745{
747 void __iomem *ioaddr; 746 void __iomem *ioaddr;
748 struct net_device *dev; 747 struct net_device *dev;
@@ -756,13 +755,11 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
756 755
757 assert (pdev != NULL); 756 assert (pdev != NULL);
758 757
759 *dev_out = NULL;
760
761 /* dev and priv zeroed in alloc_etherdev */ 758 /* dev and priv zeroed in alloc_etherdev */
762 dev = alloc_etherdev (sizeof (*tp)); 759 dev = alloc_etherdev (sizeof (*tp));
763 if (dev == NULL) { 760 if (dev == NULL) {
764 dev_err(&pdev->dev, "Unable to alloc new net device\n"); 761 dev_err(&pdev->dev, "Unable to alloc new net device\n");
765 return -ENOMEM; 762 return ERR_PTR(-ENOMEM);
766 } 763 }
767 SET_NETDEV_DEV(dev, &pdev->dev); 764 SET_NETDEV_DEV(dev, &pdev->dev);
768 765
@@ -906,14 +903,13 @@ match:
906 903
907 rtl8139_chip_reset (ioaddr); 904 rtl8139_chip_reset (ioaddr);
908 905
909 *dev_out = dev; 906 return dev;
910 return 0;
911 907
912err_out: 908err_out:
913 __rtl8139_cleanup_dev (dev); 909 __rtl8139_cleanup_dev (dev);
914 if (disable_dev_on_err) 910 if (disable_dev_on_err)
915 pci_disable_device (pdev); 911 pci_disable_device (pdev);
916 return rc; 912 return ERR_PTR(rc);
917} 913}
918 914
919static const struct net_device_ops rtl8139_netdev_ops = { 915static const struct net_device_ops rtl8139_netdev_ops = {
@@ -972,9 +968,9 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
972 use_io = 1; 968 use_io = 1;
973 } 969 }
974 970
975 i = rtl8139_init_board (pdev, &dev); 971 dev = rtl8139_init_board (pdev);
976 if (i < 0) 972 if (IS_ERR(dev))
977 return i; 973 return PTR_ERR(dev);
978 974
979 assert (dev != NULL); 975 assert (dev != NULL);
980 tp = netdev_priv(dev); 976 tp = netdev_priv(dev);