Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] VPU: mediatek: fix return value check in mtk_vpu_probe()

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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Wei Yongjun and committed by
Mauro Carvalho Chehab
ffe57033 980e0b36

+2 -2
+2 -2
drivers/media/platform/mtk-vpu/mtk_vpu.c
··· 788 788 789 789 /* Get VPU clock */ 790 790 vpu->clk = devm_clk_get(dev, "main"); 791 - if (!vpu->clk) { 791 + if (IS_ERR(vpu->clk)) { 792 792 dev_err(dev, "get vpu clock failed\n"); 793 - return -EINVAL; 793 + return PTR_ERR(vpu->clk); 794 794 } 795 795 796 796 platform_set_drvdata(pdev, vpu);