r6040.c (9edd576d89a5b6d3e136d7dcab654d887c0d25b7) | r6040.c (f2cedb63df14342ad40a8b5b324fc5d94a60b665) |
---|---|
1/* 2 * RDC R6040 Fast Ethernet MAC support 3 * 4 * Copyright (C) 2004 Sten Wang <sten.wang@rdc.com.tw> 5 * Copyright (C) 2007 6 * Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us> 7 * Florian Fainelli <florian@openwrt.org> 8 * --- 1093 unchanged lines hidden (view full) --- 1102 err = -EIO; 1103 goto err_out; 1104 } 1105 1106 pci_set_master(pdev); 1107 1108 dev = alloc_etherdev(sizeof(struct r6040_private)); 1109 if (!dev) { | 1/* 2 * RDC R6040 Fast Ethernet MAC support 3 * 4 * Copyright (C) 2004 Sten Wang <sten.wang@rdc.com.tw> 5 * Copyright (C) 2007 6 * Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us> 7 * Florian Fainelli <florian@openwrt.org> 8 * --- 1093 unchanged lines hidden (view full) --- 1102 err = -EIO; 1103 goto err_out; 1104 } 1105 1106 pci_set_master(pdev); 1107 1108 dev = alloc_etherdev(sizeof(struct r6040_private)); 1109 if (!dev) { |
1110 dev_err(&pdev->dev, "Failed to allocate etherdev\n"); | |
1111 err = -ENOMEM; 1112 goto err_out; 1113 } 1114 SET_NETDEV_DEV(dev, &pdev->dev); 1115 lp = netdev_priv(dev); 1116 1117 err = pci_request_regions(pdev, DRV_NAME); 1118 --- 28 unchanged lines hidden (view full) --- 1147 adrp[1] = ioread16(ioaddr + MID_0M); 1148 adrp[2] = ioread16(ioaddr + MID_0H); 1149 1150 /* Some bootloader/BIOSes do not initialize 1151 * MAC address, warn about that */ 1152 if (!(adrp[0] || adrp[1] || adrp[2])) { 1153 netdev_warn(dev, "MAC address not initialized, " 1154 "generating random\n"); | 1110 err = -ENOMEM; 1111 goto err_out; 1112 } 1113 SET_NETDEV_DEV(dev, &pdev->dev); 1114 lp = netdev_priv(dev); 1115 1116 err = pci_request_regions(pdev, DRV_NAME); 1117 --- 28 unchanged lines hidden (view full) --- 1146 adrp[1] = ioread16(ioaddr + MID_0M); 1147 adrp[2] = ioread16(ioaddr + MID_0H); 1148 1149 /* Some bootloader/BIOSes do not initialize 1150 * MAC address, warn about that */ 1151 if (!(adrp[0] || adrp[1] || adrp[2])) { 1152 netdev_warn(dev, "MAC address not initialized, " 1153 "generating random\n"); |
1155 random_ether_addr(dev->dev_addr); | 1154 eth_hw_addr_random(dev); |
1156 } 1157 1158 /* Link new device into r6040_root_dev */ 1159 lp->pdev = pdev; 1160 lp->dev = dev; 1161 1162 /* Init RDC private data */ 1163 lp->mcr0 = MCR0_XMTEN | MCR0_RCVEN; --- 111 unchanged lines hidden --- | 1155 } 1156 1157 /* Link new device into r6040_root_dev */ 1158 lp->pdev = pdev; 1159 lp->dev = dev; 1160 1161 /* Init RDC private data */ 1162 lp->mcr0 = MCR0_XMTEN | MCR0_RCVEN; --- 111 unchanged lines hidden --- |