Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07287C433EF for ; Fri, 26 Nov 2021 17:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235028AbhKZRdW (ORCPT ); Fri, 26 Nov 2021 12:33:22 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:38729 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235125AbhKZRbH (ORCPT ); Fri, 26 Nov 2021 12:31:07 -0500 Received: (Authenticated sender: clement.leger@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 07AE0240008; Fri, 26 Nov 2021 17:27:51 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: "David S. Miller" , Jakub Kicinski , Rob Herring , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Andrew Lunn Cc: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , Denis Kirjanov , Julian Wiedmann Subject: [PATCH net-next v3 2/4] net: ocelot: add support to get port mac from device-tree Date: Fri, 26 Nov 2021 18:27:37 +0100 Message-Id: <20211126172739.329098-3-clement.leger@bootlin.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211126172739.329098-1-clement.leger@bootlin.com> References: <20211126172739.329098-1-clement.leger@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to get mac from device-tree using of_get_mac_address. Reviewed-by: Vladimir Oltean Signed-off-by: Clément Léger --- drivers/net/ethernet/mscc/ocelot_net.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mscc/ocelot_net.c b/drivers/net/ethernet/mscc/ocelot_net.c index eaeba60b1bba..b589ae95e29b 100644 --- a/drivers/net/ethernet/mscc/ocelot_net.c +++ b/drivers/net/ethernet/mscc/ocelot_net.c @@ -1704,7 +1704,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); -- 2.33.1