Skip to content

Commit 4ebd29f

Browse files
stephan-ghShawn Guo
authored andcommitted
soc: imx: Register SoC device only on i.MX boards
At the moment, using the ARM32 multi_v7_defconfig always results in two SoCs being exposed in sysfs. This is wrong, as far as I'm aware the Qualcomm DragonBoard 410c does not actually make use of a i.MX SoC. :) qcom-db410c:/sys/devices/soc0$ grep . * family:Freescale i.MX machine:Qualcomm Technologies, Inc. APQ 8016 SBC revision:0.0 serial_number:0000000000000000 soc_id:Unknown qcom-db410c:/sys/devices/soc1$ grep . * family:Snapdragon machine:APQ8016 ... This happens because imx_soc_device_init() registers the soc device unconditionally, even when running on devices that do not make use of i.MX. Arnd already reported this more than a year ago and even suggested a fix similar to this commit, but for some reason it was never submitted. Fix it by checking if the "__mxc_cpu_type" variable was actually initialized by earlier platform code. On devices without i.MX it will simply stay 0. Cc: Peng Fan <[email protected]> Fixes: d2199b3 ("ARM: imx: use device_initcall for imx_soc_device_init") Reported-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/CAK8P3a0hxO1TmK6oOMQ70AHSWJnP_CAq57YMOutrxkSYNjFeuw@mail.gmail.com/ Signed-off-by: Stephan Gerhold <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 042b677 commit 4ebd29f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/soc/imx/soc-imx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ static int __init imx_soc_device_init(void)
3636
int ret;
3737
int i;
3838

39+
/* Return early if this is running on devices with different SoCs */
40+
if (!__mxc_cpu_type)
41+
return 0;
42+
3943
if (of_machine_is_compatible("fsl,ls1021a"))
4044
return 0;
4145

0 commit comments

Comments
 (0)