[PATCH] media: imx: imx8mq-mipi_csi2: Remove unneeded code

Marc Kleine-Budde mkl at pengutronix.de
Fri Jan 28 05:52:17 PST 2022


On 28.01.2022 18:36:49, Muhammad Usama Anjum wrote:
> 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.
> 
> Fixes: f0c2ba1ed4ad ("media: imx: imx8mq-mipi_csi2: fix system resume")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum at collabora.com>
> ---
>  drivers/staging/media/imx/imx8mq-mipi-csi2.c | 16 ++++------------
>  1 file changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> index 3b9fa75efac6b..c992b845e63d1 100644
> --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
> +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
[...]
>  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)
>  {
>  	struct v4l2_subdev *sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csi2_state(sd);
> -	int ret;
>  
> -	ret = imx8mq_mipi_csi_pm_suspend(dev);
> -	if (ret)
> -		return ret;
> +	imx8mq_mipi_csi_pm_suspend(dev);
>  
>  	state->state |= ST_SUSPENDED;


what about this flag?

Marc
>  
> -	return ret;
> +	return 0;
>  }


-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220128/edbf5613/attachment-0001.sig>


More information about the linux-arm-kernel mailing list