[PATCH master 2/5] ARM: at91: at91sam9263ek: add device tree check for board code
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Sep 21 23:49:58 PDT 2021
Most board code is guarded by a compatible check, but not add_smc_devices().
Remedy this.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/arm/boards/at91sam9263ek/of_init.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/boards/at91sam9263ek/of_init.c b/arch/arm/boards/at91sam9263ek/of_init.c
index 3cb2fe22c967..92301c80d6c8 100644
--- a/arch/arm/boards/at91sam9263ek/of_init.c
+++ b/arch/arm/boards/at91sam9263ek/of_init.c
@@ -15,6 +15,9 @@
static int add_smc_devices(void)
{
+ if (!of_machine_is_compatible("atmel,at91sam9263ek"))
+ return 0;
+
add_generic_device("at91sam9-smc", 0, NULL, AT91SAM9263_BASE_SMC0, 0x200,
IORESOURCE_MEM, NULL);
add_generic_device("at91sam9-smc", 1, NULL, AT91SAM9263_BASE_SMC1, 0x200,
--
2.30.2
More information about the barebox
mailing list