From: Peng Fan Date: Wed, 16 Oct 2019 03:01:51 +0000 (+0000) Subject: imx: imx8m: fix boot when CONFIG_$(SPL_)CLK not defined X-Git-Tag: v2020.01-rc3~7^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cd7c806f4f58fe66895f4355b1ddd88460925a01;p=oweals%2Fu-boot.git imx: imx8m: fix boot when CONFIG_$(SPL_)CLK not defined 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 Tested-by: Patrick Wildt Signed-off-by: Peng Fan --- diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index a72ce3fe1d..9a203e4736 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -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;