mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-29 01:09:33 -04:00
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 <vladimir.oltean@nxp.com> Signed-off-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3899c928bc
commit
8438699512
@@ -1695,7 +1695,10 @@ int ocelot_probe_port(struct ocelot *ocelot, int port, struct regmap *target,
|
||||
NETIF_F_HW_TC;
|
||||
dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC;
|
||||
|
||||
eth_hw_addr_gen(dev, ocelot->base_mac, port);
|
||||
err = of_get_ethdev_address(portnp, dev);
|
||||
if (err)
|
||||
eth_hw_addr_gen(dev, ocelot->base_mac, port);
|
||||
|
||||
ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr,
|
||||
OCELOT_VLAN_UNAWARE_PVID, ENTRYTYPE_LOCKED);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user