Skip to content

Commit 20bea10

Browse files
committed
Merge branch 'at91-4.19-trunk/base_net' into linux-4.19-at91
2 parents 33220b3 + 81b7008 commit 20bea10

File tree

52 files changed

+67
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+67
-59
lines changed

arch/arm/mach-mvebu/kirkwood.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ static void __init kirkwood_dt_eth_fixup(void)
9292
continue;
9393

9494
/* skip disabled nodes or nodes with valid MAC address*/
95-
if (!of_device_is_available(pnp) || of_get_mac_address(np))
95+
if (!of_device_is_available(pnp) ||
96+
!IS_ERR(of_get_mac_address(np)))
9697
goto eth_fixup_skip;
9798

9899
clk = of_clk_get(pnp, 0);

arch/powerpc/sysdev/tsi108_dev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/irq.h>
1919
#include <linux/export.h>
2020
#include <linux/device.h>
21+
#include <linux/etherdevice.h>
2122
#include <linux/platform_device.h>
2223
#include <linux/of_net.h>
2324
#include <asm/tsi108.h>
@@ -105,8 +106,8 @@ static int __init tsi108_eth_of_init(void)
105106
}
106107

107108
mac_addr = of_get_mac_address(np);
108-
if (mac_addr)
109-
memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
109+
if (!IS_ERR(mac_addr))
110+
ether_addr_copy(tsi_eth_data.mac_addr, mac_addr);
110111

111112
ph = of_get_property(np, "mdio-handle", NULL);
112113
mdio = of_find_node_by_phandle(*ph);

drivers/net/ethernet/aeroflex/greth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1459,7 +1459,7 @@ static int greth_of_probe(struct platform_device *ofdev)
14591459
const u8 *addr;
14601460

14611461
addr = of_get_mac_address(ofdev->dev.of_node);
1462-
if (addr) {
1462+
if (!IS_ERR(addr)) {
14631463
for (i = 0; i < 6; i++)
14641464
macaddr[i] = (unsigned int) addr[i];
14651465
} else {

drivers/net/ethernet/allwinner/sun4i-emac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ static int emac_probe(struct platform_device *pdev)
870870

871871
/* Read MAC-address from DT */
872872
mac_addr = of_get_mac_address(np);
873-
if (mac_addr)
873+
if (!IS_ERR(mac_addr))
874874
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
875875

876876
/* Check if the MAC address is valid, if not get a random one */

drivers/net/ethernet/altera/altera_tse_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ static int altera_tse_probe(struct platform_device *pdev)
15371537

15381538
/* get default MAC address from device tree */
15391539
macaddr = of_get_mac_address(pdev->dev.of_node);
1540-
if (macaddr)
1540+
if (!IS_ERR(macaddr))
15411541
ether_addr_copy(ndev->dev_addr, macaddr);
15421542
else
15431543
eth_hw_addr_random(ndev);

drivers/net/ethernet/arc/emac_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ int arc_emac_probe(struct net_device *ndev, int interface)
959959
/* Get MAC address from device tree */
960960
mac_addr = of_get_mac_address(dev->of_node);
961961

962-
if (mac_addr)
962+
if (!IS_ERR(mac_addr))
963963
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
964964
else
965965
eth_hw_addr_random(ndev);

drivers/net/ethernet/aurora/nb8800.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ static int nb8800_probe(struct platform_device *pdev)
14681468
dev->irq = irq;
14691469

14701470
mac = of_get_mac_address(pdev->dev.of_node);
1471-
if (mac)
1471+
if (!IS_ERR(mac))
14721472
ether_addr_copy(dev->dev_addr, mac);
14731473

14741474
if (!is_valid_ether_addr(dev->dev_addr))

drivers/net/ethernet/broadcom/bcmsysport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
24882488

24892489
/* Initialize netdevice members */
24902490
macaddr = of_get_mac_address(dn);
2491-
if (!macaddr || !is_valid_ether_addr(macaddr)) {
2491+
if (IS_ERR(macaddr)) {
24922492
dev_warn(&pdev->dev, "using random Ethernet MAC\n");
24932493
eth_hw_addr_random(dev);
24942494
} else {

drivers/net/ethernet/broadcom/bgmac-bcma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int bgmac_probe(struct bcma_device *core)
132132
mac = of_get_mac_address(bgmac->dev->of_node);
133133

134134
/* If no MAC address assigned via device tree, check SPROM */
135-
if (!mac) {
135+
if (IS_ERR_OR_NULL(mac)) {
136136
switch (core->core_unit) {
137137
case 0:
138138
mac = sprom->et0mac;

drivers/net/ethernet/broadcom/bgmac-platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int bgmac_probe(struct platform_device *pdev)
193193
bgmac->dma_dev = &pdev->dev;
194194

195195
mac_addr = of_get_mac_address(np);
196-
if (mac_addr)
196+
if (!IS_ERR(mac_addr))
197197
ether_addr_copy(bgmac->net_dev->dev_addr, mac_addr);
198198
else
199199
dev_warn(&pdev->dev, "MAC address not present in device tree\n");

0 commit comments

Comments
 (0)