Skip to content

Commit

Permalink
[media] exynos-gsc: Rearrange error messages for valid prints
Browse files Browse the repository at this point in the history
In case of clk_prepare failure, the function gsc_clk_get also prints
"failed to get clock" which is not correct. Hence move the error
messages to their respective blocks. While at it, also renamed the labels
meaningfully.

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>
  • Loading branch information
Sachin Kamat authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent 2c8cc13 commit 9318ab6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions drivers/media/platform/exynos-gsc/gsc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,25 +1017,26 @@ static int gsc_clk_get(struct gsc_dev *gsc)
dev_dbg(&gsc->pdev->dev, "gsc_clk_get Called\n");

gsc->clock = clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME);
if (IS_ERR(gsc->clock))
goto err_print;
if (IS_ERR(gsc->clock)) {
dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n",
GSC_CLOCK_GATE_NAME);
goto err_clk_get;
}

ret = clk_prepare(gsc->clock);
if (ret < 0) {
dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n",
GSC_CLOCK_GATE_NAME);
clk_put(gsc->clock);
gsc->clock = NULL;
goto err;
goto err_clk_prepare;
}

return 0;

err:
dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n",
GSC_CLOCK_GATE_NAME);
err_clk_prepare:
gsc_clk_put(gsc);
err_print:
dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n",
GSC_CLOCK_GATE_NAME);
err_clk_get:
return -ENXIO;
}

Expand Down

0 comments on commit 9318ab6

Please sign in to comment.