mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 08/11] firmware: stratix10-rsu: Convert to platform remove callback returning void
Date: Thu, 4 Jan 2024 06:22:43 -0600	[thread overview]
Message-ID: <7a873aea-f118-4dbf-9309-bffcd7317627@kernel.org> (raw)
In-Reply-To: <06df45c697a747cb6543800a4613db6e1f5462b4.1703693980.git.u.kleine-koenig@pengutronix.de>

On 12/27/23 10:26, 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>
> ---
>   drivers/firmware/stratix10-rsu.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-rsu.c
> index 4f7a7abada48..e20cee9c2d32 100644
> --- a/drivers/firmware/stratix10-rsu.c
> +++ b/drivers/firmware/stratix10-rsu.c
> @@ -793,17 +793,16 @@ static int stratix10_rsu_probe(struct platform_device *pdev)
>   	return ret;
>   }
>   
> -static int stratix10_rsu_remove(struct platform_device *pdev)
> +static void stratix10_rsu_remove(struct platform_device *pdev)
>   {
>   	struct stratix10_rsu_priv *priv = platform_get_drvdata(pdev);
>   
>   	stratix10_svc_free_channel(priv->chan);
> -	return 0;
>   }
>   
>   static struct platform_driver stratix10_rsu_driver = {
>   	.probe = stratix10_rsu_probe,
> -	.remove = stratix10_rsu_remove,
> +	.remove_new = stratix10_rsu_remove,
>   	.driver = {
>   		.name = "stratix10-rsu",
>   		.dev_groups = rsu_groups,

Acked-by: Dinh Nguyen <dinguyen@kernel.org>

  reply	other threads:[~2024-01-04 12:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 16:26 [PATCH 00/11] firmware: " Uwe Kleine-König
2023-12-27 16:26 ` [PATCH 01/11] firmware: arm_scmi: " Uwe Kleine-König
2023-12-27 16:26 ` [PATCH 02/11] firmware: arm_scpi: " Uwe Kleine-König
2023-12-27 16:26 ` [PATCH 03/11] firmware: coreboot_table: " Uwe Kleine-König
2023-12-28  3:12   ` Tzung-Bi Shih
2023-12-27 16:26 ` [PATCH 04/11] firmware: imx-dsp: " Uwe Kleine-König
2023-12-27 16:26 ` [PATCH 05/11] firmware: mtk-adsp-ipc: " Uwe Kleine-König
2023-12-27 16:26 ` [PATCH 06/11] firmware: qemu_fw_cfg: " Uwe Kleine-König
2023-12-27 17:07   ` Philippe Mathieu-Daudé
2023-12-27 20:46   ` Michael S. Tsirkin
2023-12-27 16:26 ` [PATCH 07/11] firmware: raspberrypi: " Uwe Kleine-König
2023-12-27 16:43   ` Florian Fainelli
2023-12-27 16:26 ` [PATCH 08/11] firmware: stratix10-rsu: " Uwe Kleine-König
2024-01-04 12:22   ` Dinh Nguyen [this message]
2023-12-27 16:26 ` [PATCH 09/11] firmware: stratix10-svc: " Uwe Kleine-König
2024-01-04 12:22   ` Dinh Nguyen
2023-12-27 16:26 ` [PATCH 10/11] firmware: turris-mox-rwtm: " Uwe Kleine-König
2023-12-28 15:32   ` Marek Behún
2023-12-27 16:26 ` [PATCH 11/11] firmware: zynqmp: " Uwe Kleine-König
2024-01-02 10:00   ` Michal Simek

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=7a873aea-f118-4dbf-9309-bffcd7317627@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®