Commit d46a5a68 authored by Sachin Kamat's avatar Sachin Kamat Committed by Mauro Carvalho Chehab

[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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 24f99dd0
...@@ -341,10 +341,11 @@ static void camif_clk_put(struct camif_dev *camif) ...@@ -341,10 +341,11 @@ static void camif_clk_put(struct camif_dev *camif)
int i; int i;
for (i = 0; i < CLK_MAX_NUM; i++) { for (i = 0; i < CLK_MAX_NUM; i++) {
if (IS_ERR_OR_NULL(camif->clock[i])) if (IS_ERR(camif->clock[i]))
continue; continue;
clk_unprepare(camif->clock[i]); clk_unprepare(camif->clock[i]);
clk_put(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) ...@@ -352,6 +353,9 @@ static int camif_clk_get(struct camif_dev *camif)
{ {
int ret, i; 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++) { for (i = 0; i < CLK_MAX_NUM; i++) {
camif->clock[i] = clk_get(camif->dev, camif_clocks[i]); camif->clock[i] = clk_get(camif->dev, camif_clocks[i]);
if (IS_ERR(camif->clock[i])) { if (IS_ERR(camif->clock[i])) {
......
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