imx: imx8m: fix boot when CONFIG_$(SPL_)CLK not defined
authorPeng Fan <peng.fan@nxp.com>
Wed, 16 Oct 2019 03:01:51 +0000 (03:01 +0000)
committerStefano Babic <sbabic@denx.de>
Tue, 5 Nov 2019 09:27:18 +0000 (10:27 +0100)
When CONFIG_$(SPL_)CLK not defined, the clock controller device
not exist, so to avoid boot failure for platform not have
CONFIG_$(SPL_)CLK, add a check.

Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/mach-imx/imx8m/soc.c

index a72ce3fe1d726f9decd87df8f51f63c4052e90e4..9a203e473605ea365072c6151cf46e160fb3c2f7 100644 (file)
@@ -243,12 +243,14 @@ int arch_cpu_init_dm(void)
        struct udevice *dev;
        int ret;
 
-       ret = uclass_get_device_by_name(UCLASS_CLK,
-                                       "clock-controller@30380000",
-                                       &dev);
-       if (ret < 0) {
-               printf("Failed to find clock node. Check device tree\n");
-               return ret;
+       if (CONFIG_IS_ENABLED(CLK)) {
+               ret = uclass_get_device_by_name(UCLASS_CLK,
+                                               "clock-controller@30380000",
+                                               &dev);
+               if (ret < 0) {
+                       printf("Failed to find clock node. Check device tree\n");
+                       return ret;
+               }
        }
 
        return 0;