mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Jassi Brar" <jassisinghbrar@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH 12/12] mailbox: zynqmp-ipi: Convert to platform remove callback returning void
Date: Tue, 2 Jan 2024 10:36:06 +0100	[thread overview]
Message-ID: <5b7eb790-675d-414b-a41c-6e688534de08@amd.com> (raw)
In-Reply-To: <d3343eec618fde99b47b12f792dc415d66b3d7a1.1703710628.git.u.kleine-koenig@pengutronix.de>



On 12/27/23 22:02, 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/mailbox/zynqmp-ipi-mailbox.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c
> index 7fa533e80dd9..610a92f9c0b2 100644
> --- a/drivers/mailbox/zynqmp-ipi-mailbox.c
> +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c
> @@ -688,19 +688,17 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
>   	return ret;
>   }
>   
> -static int zynqmp_ipi_remove(struct platform_device *pdev)
> +static void zynqmp_ipi_remove(struct platform_device *pdev)
>   {
>   	struct zynqmp_ipi_pdata *pdata;
>   
>   	pdata = platform_get_drvdata(pdev);
>   	zynqmp_ipi_free_mboxes(pdata);
> -
> -	return 0;
>   }
>   
>   static struct platform_driver zynqmp_ipi_driver = {
>   	.probe = zynqmp_ipi_probe,
> -	.remove = zynqmp_ipi_remove,
> +	.remove_new = zynqmp_ipi_remove,
>   	.driver = {
>   		   .name = "zynqmp-ipi",
>   		   .of_match_table = of_match_ptr(zynqmp_ipi_of_match),

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

      reply	other threads:[~2024-01-02  9:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 21:02 [PATCH 00/12] mailbox: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 01/12] mailbox: bcm-flexrm: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 02/12] mailbox: bcm-pdc: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 03/12] mailbox: imx: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 04/12] mailbox: mailbox-test: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 05/12] mailbox: mtk-cmdq: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 06/12] mailbox: omap: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 07/12] mailbox: qcom-apcs-ipc: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 08/12] mailbox: qcom-ipcc: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 09/12] mailbox: stm32-ipcc: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 10/12] mailbox: sun6i-msgbox: " Uwe Kleine-König
2024-01-09 20:15   ` Jernej Škrabec
2023-12-27 21:02 ` [PATCH 11/12] mailbox: tegra-hsp: " Uwe Kleine-König
2023-12-27 21:02 ` [PATCH 12/12] mailbox: zynqmp-ipi: " Uwe Kleine-König
2024-01-02  9:36   ` Michal Simek [this message]

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=5b7eb790-675d-414b-a41c-6e688534de08@amd.com \
    --to=michal.simek@amd.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --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®