linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Sebastian Reichel" <sre@kernel.org>
Cc: kernel@pengutronix.de,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 15/14] power: reset: at91-reset: Convert to platform remove callback returning void
Date: Wed, 8 Nov 2023 08:56:10 +0200	[thread overview]
Message-ID: <b606cf9c-6456-4270-ac4e-57fdc07707ff@tuxon.dev> (raw)
In-Reply-To: <20231105094712.3706799-3-u.kleine-koenig@pengutronix.de>



On 05.11.2023 11:47, 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 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>

Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>

> ---
>  drivers/power/reset/at91-reset.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
> index af85f2f929ba..16512654295f 100644
> --- a/drivers/power/reset/at91-reset.c
> +++ b/drivers/power/reset/at91-reset.c
> @@ -417,19 +417,17 @@ static int at91_reset_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int at91_reset_remove(struct platform_device *pdev)
> +static void at91_reset_remove(struct platform_device *pdev)
>  {
>  	struct at91_reset *reset = platform_get_drvdata(pdev);
>  
>  	unregister_restart_handler(&reset->nb);
>  	clk_disable_unprepare(reset->sclk);
> -
> -	return 0;
>  }
>  
>  static struct platform_driver at91_reset_driver = {
>  	.probe = at91_reset_probe,
> -	.remove = at91_reset_remove,
> +	.remove_new = at91_reset_remove,
>  	.driver = {
>  		.name = "at91-reset",
>  		.of_match_table = at91_reset_of_match,

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-11-08  6:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-04 21:15 [PATCH 00/14] power: reset: Drop platform_driver_probe() and convert to platform remove callback returning void Uwe Kleine-König
2023-11-04 21:15 ` [PATCH 01/14] power: reset: at91-poweroff: Stop using module_platform_driver_probe() Uwe Kleine-König
2023-11-08  6:54   ` claudiu beznea
2023-11-04 21:15 ` [PATCH 02/14] power: reset: at91-reset:: " Uwe Kleine-König
2023-11-08  6:54   ` claudiu beznea
2023-11-04 21:15 ` [PATCH 03/14] power: reset: at91-sama5d2_shdwc: " Uwe Kleine-König
2023-11-08  6:55   ` claudiu beznea
2023-11-04 21:15 ` [PATCH 05/14] power: reset: at91-poweroff: Convert to platform remove callback returning void Uwe Kleine-König
2023-11-08  6:55   ` claudiu beznea
2023-11-04 21:15 ` [PATCH 08/14] power: reset: mt6323-poweroff: " Uwe Kleine-König
2023-11-06  8:21   ` AngeloGioacchino Del Regno
2023-11-05  9:47 ` [PATCH 15/14] power: reset: at91-reset: " Uwe Kleine-König
2023-11-08  6:56   ` claudiu beznea [this message]
2023-11-05  9:47 ` [PATCH 16/14] power: reset: at91-sama5d2_shdwc: " Uwe Kleine-König
2023-11-08  6:56   ` claudiu beznea
2023-11-05  9:53 ` [PATCH 00/14] power: reset: Drop platform_driver_probe() and convert " Uwe Kleine-König
2023-11-16  0:38 ` Sebastian Reichel

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=b606cf9c-6456-4270-ac4e-57fdc07707ff@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@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;
as well as URLs for NNTP newsgroup(s).