Skip to contentSkip to conversation

sound: soc: ti: omap3pandora: fix stale ARM machine ID check to use DT

PATCH In review Ethan Nelson-Moore 2 participants 2 messages May 9

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound: soc: ti: omap3pandora: fix stale ARM machine ID check to use DT

The omap3pandora driver contains a check for the ARM machine ID via the machine_is_omap3_pandora() macro. This check is incorrect because the machine concerned now supports only FDT booting, which does not use machine IDs, and therefore it will always fail. The legacy board file for this machine was removed in commit 7fcf7e061edd ("ARM: OMAP2+:
Remove legacy booting support for Pandora"). To resolve this issue, use of_machine_is_compatible() instead.

Fixes b715da74deaf ("ARM: dts: omap3-pandora: add OMAP3530 600 MHz version")
Fixes 9ccd0106c9db ("ARM: dts: omap3-pandora: add DM3730 1 GHz version")
---
 sound/soc/ti/omap3pandora.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/ti/omap3pandora.c +3 -2
index f11b1d8a1306..6c9c184cd9d6 100644
@@ -11,12 +11,12 @@
 #include <linux/delay.h>
 #include <linux/regulator/consumer.h>
 #include <linux/module.h>
+#include <linux/of.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/soc.h>
 
-#include <asm/mach-types.h>
 #include <linux/platform_data/asoc-ti-mcbsp.h>
 
 #include "omap-mcbsp.h"
@@ -225,7 +225,8 @@ static int __init omap3pandora_soc_init(void)
 {
 	int ret;
 
-	if (!machine_is_omap3_pandora())
+	if (!of_machine_is_compatible("openpandora,omap3-pandora-600mhz") &&
+		!of_machine_is_compatible("openpandora,omap3-pandora-1ghz"))
 		return -ENODEV;
 
 	pr_info("OMAP3 Pandora SoC init\n");
Signature · 1 line
2.43.0
maintainer
#1 lore raw

Hi

Quoted 8 lines · Ethan Nelson-Moore

The omap3pandora driver contains a check for the ARM machine ID via the machine_is_omap3_pandora() macro. This check is incorrect because the machine concerned now supports only FDT booting, which does not use machine IDs, and therefore it will always fail. The legacy board file for this machine was removed in commit 7fcf7e061edd ("ARM: OMAP2+:
Remove legacy booting support for Pandora"). To resolve this issue, use of_machine_is_compatible() instead.

Quoted 7 lines
Fixes b715da74deaf ("ARM: dts: omap3-pandora: add OMAP3530 600 MHz version")
Fixes 9ccd0106c9db ("ARM: dts: omap3-pandora: add DM3730 1 GHz version")
---
 sound/soc/ti/omap3pandora.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

I guess this is the same than rx51 case that machine_is_omap3_pandora() still returns true. Dunno is there an updated bootloader for it that doesn't pass anymore the ID but I think only that case would warrant the Fixes tags?