summaryrefslogtreecommitdiff
path: root/drivers/staging/media/davinci_vpfe
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-03-11 12:57:22 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-23 14:28:21 (GMT)
commitb279265cfd677b618f2aee8089073a3e4632d85b (patch)
tree0a45a9361b8dce315ca5db458afc56c7b4db6ff9 /drivers/staging/media/davinci_vpfe
parent9719afae5e589b409e137c36f89073d134f0de33 (diff)
downloadlinux-fsl-qoriq-b279265cfd677b618f2aee8089073a3e4632d85b.tar.xz
[media] davinci: vpfe: fix return value check in vpfe_enable_clock()
In case of error, the function clk_get() returns ERR_PTR() and never 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> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Reviewed-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/media/davinci_vpfe')
-rw-r--r--drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
index c7ae7d7..b88e1dd 100644
--- a/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
+++ b/drivers/staging/media/davinci_vpfe/vpfe_mc_capture.c
@@ -243,7 +243,7 @@ static int vpfe_enable_clock(struct vpfe_device *vpfe_dev)
vpfe_dev->clks[i] =
clk_get(vpfe_dev->pdev, vpfe_cfg->clocks[i]);
- if (vpfe_dev->clks[i] == NULL) {
+ if (IS_ERR(vpfe_dev->clks[i])) {
v4l2_err(vpfe_dev->pdev->driver,
"Failed to get clock %s\n",
vpfe_cfg->clocks[i]);
@@ -264,7 +264,7 @@ static int vpfe_enable_clock(struct vpfe_device *vpfe_dev)
return 0;
out:
for (i = 0; i < vpfe_cfg->num_clocks; i++)
- if (vpfe_dev->clks[i]) {
+ if (!IS_ERR(vpfe_dev->clks[i])) {
clk_disable_unprepare(vpfe_dev->clks[i]);
clk_put(vpfe_dev->clks[i]);
}