[PATCH v1 2/6] ARM: boards: protonic-imx6: Don't fixup MAC address for disabled device

Oleksij Rempel o.rempel at pengutronix.de
Wed Aug 18 05:19:41 PDT 2021


From: Robin van der Gracht <robin at protonic.nl>

The prtvt7 board variant has no enabled ethernet interface. For these
boards the MAC address in the RFID flash is unset or invalid and should
not be copied to the device-tree.

Signed-off-by: Robin van der Gracht <robin at protonic.nl>
Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
---
 arch/arm/boards/protonic-imx6/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c
index e7938ac0fd..7368f3458f 100644
--- a/arch/arm/boards/protonic-imx6/board.c
+++ b/arch/arm/boards/protonic-imx6/board.c
@@ -171,6 +171,9 @@ static int prt_imx6_set_mac(struct prt_imx6_priv *priv,
 		return -ENODEV;
 	}
 
+	if (!of_device_is_available(node))
+		return 0;
+
 	if (!is_valid_ether_addr(&rfid->mac[0])) {
 		unsigned char ethaddr_str[sizeof("xx:xx:xx:xx:xx:xx")];
 
-- 
2.30.2




More information about the barebox mailing list