From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Chen-Yu Tsai <wens@csie.org>,
Samuel Holland <samuel@sholland.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Mark Brown <broonie@kernel.org>, Ido Schimmel <idosch@nvidia.com>,
Heiko Stuebner <heiko@sntech.de>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Rob Herring <robh@kernel.org>,
linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, kernel@pengutronix.de
Subject: Re: [PATCH 24/49] iio: adc: sun4i-gpadc-iio: Convert to platform remove callback returning void
Date: Tue, 19 Sep 2023 19:58:44 +0200 [thread overview]
Message-ID: <2243607.iZASKD2KPV@jernej-laptop> (raw)
In-Reply-To: <20230919174931.1417681-25-u.kleine-koenig@pengutronix.de>
Dne torek, 19. september 2023 ob 19:49:06 CEST je Uwe Kleine-König napisal(a):
> 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> 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>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/iio/adc/sun4i-gpadc-iio.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c
> b/drivers/iio/adc/sun4i-gpadc-iio.c index 25bba96367a8..100ecced5fc1 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -669,7 +669,7 @@ static int sun4i_gpadc_probe(struct platform_device
> *pdev) return ret;
> }
>
> -static int sun4i_gpadc_remove(struct platform_device *pdev)
> +static void sun4i_gpadc_remove(struct platform_device *pdev)
> {
> struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
> @@ -678,12 +678,10 @@ static int sun4i_gpadc_remove(struct platform_device
> *pdev) pm_runtime_disable(&pdev->dev);
>
> if (!IS_ENABLED(CONFIG_THERMAL_OF))
> - return 0;
> + return;
>
> if (!info->no_irq)
> iio_map_array_unregister(indio_dev);
> -
> - return 0;
> }
>
> static const struct platform_device_id sun4i_gpadc_id[] = {
> @@ -702,7 +700,7 @@ static struct platform_driver sun4i_gpadc_driver = {
> },
> .id_table = sun4i_gpadc_id,
> .probe = sun4i_gpadc_probe,
> - .remove = sun4i_gpadc_remove,
> + .remove_new = sun4i_gpadc_remove,
> };
> MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_id);
next prev parent reply other threads:[~2023-09-19 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 24/49] iio: adc: sun4i-gpadc-iio: " Uwe Kleine-König
2023-09-19 17:58 ` Jernej Škrabec [this message]
2023-09-23 17:35 ` [PATCH 00/49] iio: " Jonathan Cameron
2023-11-13 3:23 ` patchwork-bot+chrome-platform
2023-11-13 3:42 ` patchwork-bot+chrome-platform
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=2243607.iZASKD2KPV@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=broonie@kernel.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=daniel.lezcano@linaro.org \
--cc=heiko@sntech.de \
--cc=idosch@nvidia.com \
--cc=jic23@kernel.org \
--cc=kernel@pengutronix.de \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=rafael.j.wysocki@intel.com \
--cc=robh@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