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:
Родитель
3899c928bc
Коммит
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);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче