diff options
author | Matthias Brugger <mbrugger@suse.com> | 2020-02-13 21:19:46 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-03-12 17:28:01 +0100 |
commit | c6d8269700ff7cf763dce6ebebc5a2203c2cd455 (patch) | |
tree | 266e1e3bceeebea9f531f5e4bba7e9a26b65c835 /drivers/media/platform | |
parent | a5e72cfa6a75361da69bfb9177ddf7ef7303c1e3 (diff) |
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>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) |