提交 cd7c806f 编写于 作者: P Peng Fan 提交者: Stefano Babic

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: NPatrick Wildt <patrick@blueri.se>
Tested-by: NPatrick Wildt <patrick@blueri.se>
Signed-off-by: NPeng Fan <peng.fan@nxp.com>
上级 d239d9d9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册