Commit 3a6cddab authored by Muhammad Usama Anjum's avatar Muhammad Usama Anjum Committed by Mauro Carvalho Chehab

media: imx: imx8mq-mipi_csi2: Remove unneeded code

ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot
return error. Remove the return variable. Simplify other functions which
are using this function.
Signed-off-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: default avatarFabio Estevam <festevam@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent f99c4ad3
...@@ -693,11 +693,10 @@ static int imx8mq_mipi_csi_async_register(struct csi_state *state) ...@@ -693,11 +693,10 @@ static int imx8mq_mipi_csi_async_register(struct csi_state *state)
* Suspend/resume * Suspend/resume
*/ */
static int imx8mq_mipi_csi_pm_suspend(struct device *dev) static void imx8mq_mipi_csi_pm_suspend(struct device *dev)
{ {
struct v4l2_subdev *sd = dev_get_drvdata(dev); struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct csi_state *state = mipi_sd_to_csi2_state(sd); struct csi_state *state = mipi_sd_to_csi2_state(sd);
int ret = 0;
mutex_lock(&state->lock); mutex_lock(&state->lock);
...@@ -708,8 +707,6 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev) ...@@ -708,8 +707,6 @@ static int imx8mq_mipi_csi_pm_suspend(struct device *dev)
} }
mutex_unlock(&state->lock); mutex_unlock(&state->lock);
return ret ? -EAGAIN : 0;
} }
static int imx8mq_mipi_csi_pm_resume(struct device *dev) static int imx8mq_mipi_csi_pm_resume(struct device *dev)
...@@ -742,15 +739,12 @@ static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev) ...@@ -742,15 +739,12 @@ static int __maybe_unused imx8mq_mipi_csi_suspend(struct device *dev)
{ {
struct v4l2_subdev *sd = dev_get_drvdata(dev); struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct csi_state *state = mipi_sd_to_csi2_state(sd); struct csi_state *state = mipi_sd_to_csi2_state(sd);
int ret;
ret = imx8mq_mipi_csi_pm_suspend(dev); imx8mq_mipi_csi_pm_suspend(dev);
if (ret)
return ret;
state->state |= ST_SUSPENDED; state->state |= ST_SUSPENDED;
return ret; return 0;
} }
static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev) static int __maybe_unused imx8mq_mipi_csi_resume(struct device *dev)
...@@ -770,9 +764,7 @@ static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev) ...@@ -770,9 +764,7 @@ static int __maybe_unused imx8mq_mipi_csi_runtime_suspend(struct device *dev)
struct csi_state *state = mipi_sd_to_csi2_state(sd); struct csi_state *state = mipi_sd_to_csi2_state(sd);
int ret; int ret;
ret = imx8mq_mipi_csi_pm_suspend(dev); imx8mq_mipi_csi_pm_suspend(dev);
if (ret)
return ret;
ret = icc_set_bw(state->icc_path, 0, 0); ret = icc_set_bw(state->icc_path, 0, 0);
if (ret) if (ret)
......
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