[PATCH] ARM: Layerscape: ls1046ardb: add missing machine protection

Sascha Hauer s.hauer at pengutronix.de
Wed Nov 6 23:24:51 PST 2024


rdb_late_init() should only run on the appropriate machine. Check the
machine before continuing.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/boards/ls1046ardb/board.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boards/ls1046ardb/board.c b/arch/arm/boards/ls1046ardb/board.c
index ee70171ca3..9570344b92 100644
--- a/arch/arm/boards/ls1046ardb/board.c
+++ b/arch/arm/boards/ls1046ardb/board.c
@@ -125,6 +125,9 @@ static struct nxid *nxp_nxid_read(const char *filename, unsigned int offset)
 
 static int rdb_late_init(void)
 {
+	if (!of_machine_is_compatible("fsl,ls1046a-rdb"))
+		return 0;
+
 	nxp_nxid_read("/dev/eeprom", 256);
 
 	return 0;
-- 
2.39.5




More information about the barebox mailing list