Linux USB
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Conor Dooley <conor.dooley@microchip.com>,
	Daire McNamara <daire.mcnamara@microchip.com>,
	Bin Liu <b-liu@ti.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-riscv@lists.infradead.org, linux-usb@vger.kernel.org,
	kernel@pengutronix.de
Subject: Re: [PATCH 04/10] usb: musb: mpfs: Convert to platform remove callback returning void
Date: Wed, 5 Apr 2023 15:33:26 +0100	[thread overview]
Message-ID: <20230405-brought-sibling-3b0b62f953cd@spud> (raw)
In-Reply-To: <20230405141009.3400693-5-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 2044 bytes --]

On Wed, Apr 05, 2023 at 04:10:03PM +0200, 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 (mostly) ignored
> 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.
> 
> 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: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

> ---
>  drivers/usb/musb/mpfs.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/musb/mpfs.c b/drivers/usb/musb/mpfs.c
> index cea2e8108867..24b98716f7fc 100644
> --- a/drivers/usb/musb/mpfs.c
> +++ b/drivers/usb/musb/mpfs.c
> @@ -235,15 +235,13 @@ static int mpfs_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int mpfs_remove(struct platform_device *pdev)
> +static void mpfs_remove(struct platform_device *pdev)
>  {
>  	struct mpfs_glue *glue = platform_get_drvdata(pdev);
>  
>  	clk_disable_unprepare(glue->clk);
>  	platform_device_unregister(glue->musb);
>  	usb_phy_generic_unregister(pdev);
> -
> -	return 0;
>  }
>  
>  #ifdef CONFIG_OF
> @@ -256,7 +254,7 @@ MODULE_DEVICE_TABLE(of, mpfs_id_table);
>  
>  static struct platform_driver mpfs_musb_driver = {
>  	.probe = mpfs_probe,
> -	.remove = mpfs_remove,
> +	.remove_new = mpfs_remove,
>  	.driver = {
>  		.name = "mpfs-musb",
>  		.of_match_table = of_match_ptr(mpfs_id_table)
> -- 
> 2.39.2
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-04-05 14:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 14:09 [PATCH 00/10] usb: musb: Convert to platform remove callback returning void Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 01/10] usb: musb: da8xx: " Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 02/10] usb: musb: jz4740: " Uwe Kleine-König
2023-04-05 14:12   ` Paul Cercueil
2023-04-06 12:12   ` Philippe Mathieu-Daudé
2023-04-05 14:10 ` [PATCH 03/10] usb: musb: mediatek: " Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 04/10] usb: musb: mpfs: " Uwe Kleine-König
2023-04-05 14:33   ` Conor Dooley [this message]
2023-04-05 14:10 ` [PATCH 05/10] usb: musb: musb_core: " Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 06/10] usb: musb: musb_dsps: " Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 07/10] usb: musb: omap2430: " Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 08/10] usb: musb: sunxi: " Uwe Kleine-König
2023-04-05 15:42   ` Jernej Škrabec
2023-04-05 14:10 ` [PATCH 09/10] usb: musb: tusb6010: " Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 10/10] usb: musb: ux500: " Uwe Kleine-König

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=20230405-brought-sibling-3b0b62f953cd@spud \
    --to=conor@kernel.org \
    --cc=b-liu@ti.com \
    --cc=conor.dooley@microchip.com \
    --cc=daire.mcnamara@microchip.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-usb@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