Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	kernel@pengutronix.de
Subject: Re: [PATCH 050/117] media: rcar-csi2: Convert to platform remove callback returning void
Date: Mon, 27 Mar 2023 10:49:00 +0200	[thread overview]
Message-ID: <ZCFYfD5MUHCPCchu@oden.dyn.berto.se> (raw)
In-Reply-To: <20230326143224.572654-53-u.kleine-koenig@pengutronix.de>

On 2023-03-26 16:31:17 +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-csi2.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
> index 174aa6176f54..1632c9a53ac4 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
> @@ -1574,7 +1574,7 @@ static int rcsi2_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int rcsi2_remove(struct platform_device *pdev)
> +static void rcsi2_remove(struct platform_device *pdev)
>  {
>  	struct rcar_csi2 *priv = platform_get_drvdata(pdev);
>  
> @@ -1585,12 +1585,10 @@ static int rcsi2_remove(struct platform_device *pdev)
>  	pm_runtime_disable(&pdev->dev);
>  
>  	mutex_destroy(&priv->lock);
> -
> -	return 0;
>  }
>  
>  static struct platform_driver rcar_csi2_pdrv = {
> -	.remove	= rcsi2_remove,
> +	.remove_new = rcsi2_remove,
>  	.probe	= rcsi2_probe,
>  	.driver	= {
>  		.name	= "rcar-csi2",
> -- 
> 2.39.2
> 

-- 
Kind Regards,
Niklas Söderlund

  parent reply	other threads:[~2023-03-27  8:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 047/117] media: rcar-fcp: " Uwe Kleine-König
2023-03-27  7:04   ` Geert Uytterhoeven
2023-03-26 14:31 ` [PATCH 048/117] media: rcar-isp: " Uwe Kleine-König
2023-03-27  7:10   ` Geert Uytterhoeven
2023-03-27  8:48   ` Niklas Söderlund
2023-03-26 14:31 ` [PATCH 049/117] media: rcar-core: " Uwe Kleine-König
2023-03-27  7:09   ` Geert Uytterhoeven
2023-03-27  8:47   ` Niklas Söderlund
2023-03-26 14:31 ` [PATCH 050/117] media: rcar-csi2: " Uwe Kleine-König
2023-03-27  7:13   ` Geert Uytterhoeven
2023-03-27  8:49   ` Niklas Söderlund [this message]
2023-03-26 14:31 ` [PATCH 051/117] media: rcar_drif: " Uwe Kleine-König
2023-03-27  7:12   ` Geert Uytterhoeven
2023-03-28 13:54   ` Fabrizio Castro
2023-03-26 14:31 ` [PATCH 052/117] media: rcar_fdp1: " Uwe Kleine-König
2023-03-27  7:12   ` Geert Uytterhoeven
2023-03-27  8:39   ` Kieran Bingham
2023-03-26 14:31 ` [PATCH 053/117] media: rcar_jpu: " Uwe Kleine-König
2023-03-27  7:11   ` Geert Uytterhoeven
2023-03-26 14:31 ` [PATCH 054/117] media: renesas-ceu: " Uwe Kleine-König
2023-03-27  7:13   ` Geert Uytterhoeven
2023-03-26 14:31 ` [PATCH 058/117] media: vsp1_drv: " Uwe Kleine-König
2023-03-27  7:11   ` Geert Uytterhoeven
2023-03-27  8:41   ` Kieran Bingham
2023-04-17  6:02 ` [PATCH 000/117] media: " Uwe Kleine-König
2023-04-17  6:19   ` Laurent Pinchart
2023-04-17  7:30     ` Uwe Kleine-König
2023-04-17  7:35       ` Laurent Pinchart
2023-04-17  7:57       ` Biju Das
2023-04-17  8:54         ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZCFYfD5MUHCPCchu@oden.dyn.berto.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox