Commit 2efeec2d authored by Wei Yongjun's avatar Wei Yongjun Committed by Mauro Carvalho Chehab

[media] vcodec: mediatek: Fix return value check in mtk_vcodec_init_enc_pm()

In case of error, the function devm_clk_get() returns ERR_PTR()
and not returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 14ee452f
......@@ -67,27 +67,27 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
pm->dev = &pdev->dev;
pm->vencpll_d2 = devm_clk_get(&pdev->dev, "venc_sel_src");
if (pm->vencpll_d2 == NULL) {
if (IS_ERR(pm->vencpll_d2)) {
mtk_v4l2_err("devm_clk_get vencpll_d2 fail");
ret = -1;
ret = PTR_ERR(pm->vencpll_d2);
}
pm->venc_sel = devm_clk_get(&pdev->dev, "venc_sel");
if (pm->venc_sel == NULL) {
if (IS_ERR(pm->venc_sel)) {
mtk_v4l2_err("devm_clk_get venc_sel fail");
ret = -1;
ret = PTR_ERR(pm->venc_sel);
}
pm->univpll1_d2 = devm_clk_get(&pdev->dev, "venc_lt_sel_src");
if (pm->univpll1_d2 == NULL) {
if (IS_ERR(pm->univpll1_d2)) {
mtk_v4l2_err("devm_clk_get univpll1_d2 fail");
ret = -1;
ret = PTR_ERR(pm->univpll1_d2);
}
pm->venc_lt_sel = devm_clk_get(&pdev->dev, "venc_lt_sel");
if (pm->venc_lt_sel == NULL) {
if (IS_ERR(pm->venc_lt_sel)) {
mtk_v4l2_err("devm_clk_get venc_lt_sel fail");
ret = -1;
ret = PTR_ERR(pm->venc_lt_sel);
}
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment