提交 38367073 编写于 作者: E Evgeny Novikov 提交者: Mauro Carvalho Chehab

media: tegra-cec: Handle errors of clk_prepare_enable()

tegra_cec_probe() and tegra_cec_resume() ignored possible errors of
clk_prepare_enable(). The patch fixes this.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NEvgeny Novikov <novikov@ispras.ru>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+huawei@kernel.org>
上级 c8b26393
...@@ -366,7 +366,11 @@ static int tegra_cec_probe(struct platform_device *pdev) ...@@ -366,7 +366,11 @@ static int tegra_cec_probe(struct platform_device *pdev)
return -ENOENT; return -ENOENT;
} }
clk_prepare_enable(cec->clk); ret = clk_prepare_enable(cec->clk);
if (ret) {
dev_err(&pdev->dev, "Unable to prepare clock for CEC\n");
return ret;
}
/* set context info. */ /* set context info. */
cec->dev = &pdev->dev; cec->dev = &pdev->dev;
...@@ -446,9 +450,7 @@ static int tegra_cec_resume(struct platform_device *pdev) ...@@ -446,9 +450,7 @@ static int tegra_cec_resume(struct platform_device *pdev)
dev_notice(&pdev->dev, "Resuming\n"); dev_notice(&pdev->dev, "Resuming\n");
clk_prepare_enable(cec->clk); return clk_prepare_enable(cec->clk);
return 0;
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册