All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Bin Liu <b-liu@ti.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	kernel@pengutronix.de
Subject: [PATCH 07/10] usb: musb: omap2430: Convert to platform remove callback returning void
Date: Wed,  5 Apr 2023 16:10:06 +0200	[thread overview]
Message-ID: <20230405141009.3400693-8-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20230405141009.3400693-1-u.kleine-koenig@pengutronix.de>

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>
---
 drivers/usb/musb/omap2430.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 44a21ec865fb..b9ab0c48e2ee 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -471,14 +471,12 @@ static int omap2430_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int omap2430_remove(struct platform_device *pdev)
+static void omap2430_remove(struct platform_device *pdev)
 {
 	struct omap2430_glue *glue = platform_get_drvdata(pdev);
 
 	platform_device_unregister(glue->musb);
 	pm_runtime_disable(glue->dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -610,7 +608,7 @@ MODULE_DEVICE_TABLE(of, omap2430_id_table);
 
 static struct platform_driver omap2430_driver = {
 	.probe		= omap2430_probe,
-	.remove		= omap2430_remove,
+	.remove_new	= omap2430_remove,
 	.driver		= {
 		.name	= "musb-omap2430",
 		.pm	= DEV_PM_OPS,
-- 
2.39.2


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

Thread overview: 22+ 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:09 ` Uwe Kleine-König
2023-04-05 14:09 ` 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   ` Uwe Kleine-König
2023-04-05 14:10 ` [PATCH 04/10] usb: musb: mpfs: " Uwe Kleine-König
2023-04-05 14:10   ` Uwe Kleine-König
2023-04-05 14:33   ` Conor Dooley
2023-04-05 14:33     ` Conor Dooley
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 ` Uwe Kleine-König [this message]
2023-04-05 14:10 ` [PATCH 08/10] usb: musb: sunxi: " Uwe Kleine-König
2023-04-05 14:10   ` Uwe Kleine-König
2023-04-05 15:42   ` Jernej Škrabec
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=20230405141009.3400693-8-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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.