summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorClément Léger <clement.leger@bootlin.com>2021-12-14 10:55:34 +0100
committerDavid S. Miller <davem@davemloft.net>2021-12-15 10:29:41 +0000
commit843869951258f38dc3d9702a19df7c4c79911aee (patch)
tree514640176b6c264906c8d7a902f901e5911805c0 /drivers
parent3899c928bccc5068405cd0e9a3a8fea67b097e9e (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mscc/ocelot_net.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c
index 5fc8a0f8e8cd..8115c3db252e 100644
--- a/drivers/net/ethernet/mscc/ocelot_net.c
+++ b/drivers/net/ethernet/mscc/ocelot_net.c
@@ -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);