From c6d8269700ff7cf763dce6ebebc5a2203c2cd455 Mon Sep 17 00:00:00 2001 From: Matthias Brugger Date: Thu, 13 Feb 2020 21:19:46 +0100 Subject: 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/media/platform') diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c index 9afe8161a8c0..14991685adb7 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_comp.c @@ -110,6 +110,12 @@ int mtk_mdp_comp_init(struct device *dev, struct device_node *node, for (i = 0; i < ARRAY_SIZE(comp->clk); i++) { comp->clk[i] = of_clk_get(node, i); + if (IS_ERR(comp->clk[i])) { + if (PTR_ERR(comp->clk[i]) != -EPROBE_DEFER) + dev_err(dev, "Failed to get clock\n"); + + return PTR_ERR(comp->clk[i]); + } /* Only RDMA needs two clocks */ if (comp->type != MTK_MDP_RDMA) -- cgit v1.2.3-58-ga151