diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-04-30 07:16:18 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-13 02:41:54 +0200 |
commit | d46a5a68b1690fc9f47d6b3e13ccef4e79a87e84 (patch) | |
tree | 9c0610b675c77a703e78400a9f5a40ef7c6ef5e5 /drivers/media | |
parent | [media] exynos4-is: Remove redundant NULL check in fimc-lite.c (diff) | |
download | linux-d46a5a68b1690fc9f47d6b3e13ccef4e79a87e84.tar.xz linux-d46a5a68b1690fc9f47d6b3e13ccef4e79a87e84.zip |
[media] s3c-camif: Remove redundant NULL check
clk_unprepare checks for NULL pointer. Hence convert IS_ERR_OR_NULL
to IS_ERR only.
[s.nawrocki: added initialisation of the clock array to ERR_PTR() value]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/s3c-camif/camif-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/platform/s3c-camif/camif-core.c b/drivers/media/platform/s3c-camif/camif-core.c index 0d0fab1a7b5e..b38574702fe9 100644 --- a/drivers/media/platform/s3c-camif/camif-core.c +++ b/drivers/media/platform/s3c-camif/camif-core.c @@ -341,10 +341,11 @@ static void camif_clk_put(struct camif_dev *camif) int i; for (i = 0; i < CLK_MAX_NUM; i++) { - if (IS_ERR_OR_NULL(camif->clock[i])) + if (IS_ERR(camif->clock[i])) continue; clk_unprepare(camif->clock[i]); clk_put(camif->clock[i]); + camif->clock[i] = ERR_PTR(-EINVAL); } } @@ -352,6 +353,9 @@ static int camif_clk_get(struct camif_dev *camif) { int ret, i; + for (i = 1; i < CLK_MAX_NUM; i++) + camif->clock[i] = ERR_PTR(-EINVAL); + for (i = 0; i < CLK_MAX_NUM; i++) { camif->clock[i] = clk_get(camif->dev, camif_clocks[i]); if (IS_ERR(camif->clock[i])) { |