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>
This commit is contained in:
Matthias Brugger 2020-02-13 21:19:46 +01:00 committed by Mauro Carvalho Chehab
parent a5e72cfa6a
commit c6d8269700
1 changed files with 6 additions and 0 deletions

View File

@ -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)