Skip to content

Commit 8438699

Browse files
clementlegerdavem330
authored andcommitted
net: ocelot: add support to get port mac from device-tree
Add support to get mac from device-tree using of_get_ethdev_address. Reviewed-by: Vladimir Oltean <[email protected]> Signed-off-by: Clément Léger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3899c92 commit 8438699

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/mscc/ocelot_net.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,10 @@ int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target,
16951695
NETIF_F_HW_TC;
16961696
dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC;
16971697

1698-
eth_hw_addr_gen(dev, ocelot->base_mac, port);
1698+
err = of_get_ethdev_address(portnp, dev);
1699+
if (err)
1700+
eth_hw_addr_gen(dev, ocelot->base_mac, port);
1701+
16991702
ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr,
17001703
OCELOT_VLAN_UNAWARE_PVID, ENTRYTYPE_LOCKED);
17011704

0 commit comments

Comments
 (0)