All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>
Cc: kernel@pengutronix.de, linux-mips@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH 06/15] memory: jz4780-nemc: Convert to platform remove callback returning void
Date: Sun, 17 Dec 2023 15:40:29 +0100	[thread overview]
Message-ID: <11e0d8b13cc835d8f99046110842d6bc569ff7a8.camel@crapouillou.net> (raw)
In-Reply-To: <fa609b805a7ed6e4c6ce81464528ea4163625d67.1702822744.git.u.kleine-koenig@pengutronix.de>

Hi,

Le dimanche 17 décembre 2023 à 15:29 +0100, Uwe Kleine-König a écrit :
> 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: Paul Cercueil <paul@crapouillou.net>

Cheers,
-Paul

> ---
>  drivers/memory/jz4780-nemc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/memory/jz4780-nemc.c b/drivers/memory/jz4780-
> nemc.c
> index e5a93e7da15f..fb6db2ffe71b 100644
> --- a/drivers/memory/jz4780-nemc.c
> +++ b/drivers/memory/jz4780-nemc.c
> @@ -384,12 +384,11 @@ static int jz4780_nemc_probe(struct
> platform_device *pdev)
>  	return 0;
>  }
>  
> -static int jz4780_nemc_remove(struct platform_device *pdev)
> +static void jz4780_nemc_remove(struct platform_device *pdev)
>  {
>  	struct jz4780_nemc *nemc = platform_get_drvdata(pdev);
>  
>  	clk_disable_unprepare(nemc->clk);
> -	return 0;
>  }
>  
>  static const struct jz_soc_info jz4740_soc_info = {
> @@ -408,7 +407,7 @@ static const struct of_device_id
> jz4780_nemc_dt_match[] = {
>  
>  static struct platform_driver jz4780_nemc_driver = {
>  	.probe		= jz4780_nemc_probe,
> -	.remove		= jz4780_nemc_remove,
> +	.remove_new	= jz4780_nemc_remove,
>  	.driver	= {
>  		.name	= "jz4780-nemc",
>  		.of_match_table =
> of_match_ptr(jz4780_nemc_dt_match),


  reply	other threads:[~2023-12-17 14:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-17 14:29 [PATCH 00/15] memory: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-17 14:29 ` Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 01/15] memory: brcmstb_dpfe: " Uwe Kleine-König
2023-12-17 14:29   ` Uwe Kleine-König
2023-12-18  6:56   ` Markus Mayer
2023-12-18  6:56     ` Markus Mayer
2023-12-17 14:29 ` [PATCH 02/15] memory: brcmstb_memc: " Uwe Kleine-König
2023-12-17 14:29   ` Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 03/15] memory: emif: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 04/15] memory: fsl-corenet-cf: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 05/15] memory: fsl_ifc: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 06/15] memory: jz4780-nemc: " Uwe Kleine-König
2023-12-17 14:40   ` Paul Cercueil [this message]
2023-12-17 14:29 ` [PATCH 07/15] memory: mtk-smi: " Uwe Kleine-König
2023-12-17 14:29   ` Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 08/15] memory: omap-gpmc: " Uwe Kleine-König
2023-12-18  8:37   ` Tony Lindgren
2023-12-17 14:29 ` [PATCH 09/15] memory: renesas-rpc-if: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 10/15] memory: exynos5422-dmc: " Uwe Kleine-König
2023-12-17 14:29   ` Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 11/15] memory: stm32-fmc2-ebi: " Uwe Kleine-König
2023-12-17 14:29   ` Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 12/15] memory: tegra186-emc: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 13/15] memory: tegra210-emc: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 14/15] memory: ti-aemif: " Uwe Kleine-König
2023-12-17 14:29 ` [PATCH 15/15] memory: ti-emif-pm: " Uwe Kleine-König
2023-12-19  8:06 ` [PATCH 00/15] memory: " Krzysztof Kozlowski
2023-12-19  8:06   ` Krzysztof Kozlowski
2023-12-19  8:06 ` Krzysztof Kozlowski
2023-12-19  8:06   ` Krzysztof Kozlowski

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=11e0d8b13cc835d8f99046110842d6bc569ff7a8.camel@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.