Commit 97185c45 authored by Wan Jiabing's avatar Wan Jiabing Committed by Mauro Carvalho Chehab

media: st-delta: Remove unneeded NULL check in delta-v4l2

clk_prepare_enable() already checks NULL by using !clk.
clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.
Remove unneeded NULL checks before them.
Signed-off-by: default avatarWan Jiabing <wanjiabing@vivo.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 6aaf006c
...@@ -1669,12 +1669,10 @@ static int delta_open(struct file *file) ...@@ -1669,12 +1669,10 @@ static int delta_open(struct file *file)
set_default_params(ctx); set_default_params(ctx);
/* enable ST231 clocks */ /* enable ST231 clocks */
if (delta->clk_st231)
if (clk_prepare_enable(delta->clk_st231)) if (clk_prepare_enable(delta->clk_st231))
dev_warn(delta->dev, "failed to enable st231 clk\n"); dev_warn(delta->dev, "failed to enable st231 clk\n");
/* enable FLASH_PROMIP clock */ /* enable FLASH_PROMIP clock */
if (delta->clk_flash_promip)
if (clk_prepare_enable(delta->clk_flash_promip)) if (clk_prepare_enable(delta->clk_flash_promip))
dev_warn(delta->dev, "failed to enable delta promip clk\n"); dev_warn(delta->dev, "failed to enable delta promip clk\n");
...@@ -1717,11 +1715,9 @@ static int delta_release(struct file *file) ...@@ -1717,11 +1715,9 @@ static int delta_release(struct file *file)
v4l2_fh_exit(&ctx->fh); v4l2_fh_exit(&ctx->fh);
/* disable ST231 clocks */ /* disable ST231 clocks */
if (delta->clk_st231)
clk_disable_unprepare(delta->clk_st231); clk_disable_unprepare(delta->clk_st231);
/* disable FLASH_PROMIP clock */ /* disable FLASH_PROMIP clock */
if (delta->clk_flash_promip)
clk_disable_unprepare(delta->clk_flash_promip); clk_disable_unprepare(delta->clk_flash_promip);
dev_dbg(delta->dev, "%s decoder instance released\n", ctx->name); dev_dbg(delta->dev, "%s decoder instance released\n", ctx->name);
...@@ -1926,7 +1922,6 @@ static int delta_runtime_suspend(struct device *dev) ...@@ -1926,7 +1922,6 @@ static int delta_runtime_suspend(struct device *dev)
{ {
struct delta_dev *delta = dev_get_drvdata(dev); struct delta_dev *delta = dev_get_drvdata(dev);
if (delta->clk_delta)
clk_disable_unprepare(delta->clk_delta); clk_disable_unprepare(delta->clk_delta);
return 0; return 0;
...@@ -1936,7 +1931,6 @@ static int delta_runtime_resume(struct device *dev) ...@@ -1936,7 +1931,6 @@ static int delta_runtime_resume(struct device *dev)
{ {
struct delta_dev *delta = dev_get_drvdata(dev); struct delta_dev *delta = dev_get_drvdata(dev);
if (delta->clk_delta)
if (clk_prepare_enable(delta->clk_delta)) if (clk_prepare_enable(delta->clk_delta))
dev_warn(dev, "failed to prepare/enable delta clk\n"); dev_warn(dev, "failed to prepare/enable delta clk\n");
......
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