From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Maxime Ripard <mripard@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH 15/24] staging: media: sunxi: cedrus: Convert to platform remove callback returning void
Date: Tue, 4 Apr 2023 10:47:00 +0200 [thread overview]
Message-ID: <ZCvkBEddzwUDcdu-@aptenodytes> (raw)
In-Reply-To: <20230403154014.2564054-16-u.kleine-koenig@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]
Hi,
On Mon 03 Apr 23, 17:40, 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: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Thanks,
Paul
> ---
> drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
> index a43d5ff66716..3c62376c3e94 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
> @@ -543,7 +543,7 @@ static int cedrus_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int cedrus_remove(struct platform_device *pdev)
> +static void cedrus_remove(struct platform_device *pdev)
> {
> struct cedrus_dev *dev = platform_get_drvdata(pdev);
>
> @@ -558,8 +558,6 @@ static int cedrus_remove(struct platform_device *pdev)
> v4l2_device_unregister(&dev->v4l2_dev);
>
> cedrus_hw_remove(dev);
> -
> - return 0;
> }
>
> static const struct cedrus_variant sun4i_a10_cedrus_variant = {
> @@ -706,7 +704,7 @@ static const struct dev_pm_ops cedrus_dev_pm_ops = {
>
> static struct platform_driver cedrus_driver = {
> .probe = cedrus_probe,
> - .remove = cedrus_remove,
> + .remove_new = cedrus_remove,
> .driver = {
> .name = CEDRUS_NAME,
> .of_match_table = of_match_ptr(cedrus_dt_match),
> --
> 2.39.2
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-04-04 8:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 06/24] staging: media: atmel-sama5d2-isc: " Uwe Kleine-König
2023-04-03 16:24 ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 07/24] staging: media: atmel-sama7g5-isc: " Uwe Kleine-König
2023-04-03 16:23 ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 08/24] staging: media: imx-media-csi: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:39 ` [PATCH 09/24] staging: media: imx-media-dev: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 10/24] staging: media: imx6-mipi-csi2: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 11/24] staging: media: imx8mq-mipi-csi2: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 12/24] staging: media: meson: vdec: " Uwe Kleine-König
2023-04-03 20:38 ` Martin Blumenstingl
2023-04-03 15:40 ` [PATCH 13/24] staging: media: omap4iss: " Uwe Kleine-König
2023-04-04 2:25 ` Laurent Pinchart
2023-04-03 15:40 ` [PATCH 14/24] staging: media: rkvdec: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski [this message]
2023-04-04 16:53 ` Jernej Škrabec
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:54 ` Jernej Škrabec
2023-04-03 19:50 ` [PATCH 00/24] staging: " Greg Kroah-Hartman
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=ZCvkBEddzwUDcdu-@aptenodytes \
--to=paul.kocialkowski@bootlin.com \
--cc=gregkh@linuxfoundation.org \
--cc=jernej.skrabec@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=mripard@kernel.org \
--cc=samuel@sholland.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=wens@csie.org \
/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