Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: mtk-mdp: Check return value of of_clk_get

Check the return value of of_clk_get and print an error
message if not EPROBE_DEFER.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Matthias Brugger and committed by
Mauro Carvalho Chehab
c6d82697 a5e72cfa

+6
+6
drivers/media/platform/mtk-mdp/mtk_mdp_comp.c
··· 110 110 111 111 for (i = 0; i < ARRAY_SIZE(comp->clk); i++) { 112 112 comp->clk[i] = of_clk_get(node, i); 113 + if (IS_ERR(comp->clk[i])) { 114 + if (PTR_ERR(comp->clk[i]) != -EPROBE_DEFER) 115 + dev_err(dev, "Failed to get clock\n"); 116 + 117 + return PTR_ERR(comp->clk[i]); 118 + } 113 119 114 120 /* Only RDMA needs two clocks */ 115 121 if (comp->type != MTK_MDP_RDMA)