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 049/117] media: rcar-core: Convert to platform remove callback returning void
Date: Mon, 27 Mar 2023 10:47:53 +0200 [thread overview]
Message-ID: <ZCFYOQsi4ftHP7Ut@oden.dyn.berto.se> (raw)
In-Reply-To: <20230326143224.572654-52-u.kleine-koenig@pengutronix.de>
On 2023-03-26 16:31:16 +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-core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> index 5e53d6b7036c..1398f147e5c2 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -1442,7 +1442,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static int rcar_vin_remove(struct platform_device *pdev)
> +static void rcar_vin_remove(struct platform_device *pdev)
> {
> struct rvin_dev *vin = platform_get_drvdata(pdev);
>
> @@ -1458,8 +1458,6 @@ static int rcar_vin_remove(struct platform_device *pdev)
> rvin_parallel_cleanup(vin);
>
> rvin_dma_unregister(vin);
> -
> - return 0;
> }
>
> static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
> @@ -1472,7 +1470,7 @@ static struct platform_driver rcar_vin_driver = {
> .of_match_table = rvin_of_id_table,
> },
> .probe = rcar_vin_probe,
> - .remove = rcar_vin_remove,
> + .remove_new = rcar_vin_remove,
> };
>
> module_platform_driver(rcar_vin_driver);
> --
> 2.39.2
>
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2023-03-27 8:52 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 [this message]
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
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=ZCFYOQsi4ftHP7Ut@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