From: Yangtao Li <frank.li@vivo.com>
To: Ludovic Desroches <ludovic.desroches@microchip.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Claudiu Beznea <claudiu.beznea@microchip.com>
Cc: "Yangtao Li" <frank.li@vivo.com>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 46/58] mmc: atmel-mci: Convert to platform remove callback returning void
Date: Thu, 13 Jul 2023 16:07:55 +0800 [thread overview]
Message-ID: <20230713080807.69999-46-frank.li@vivo.com> (raw)
In-Reply-To: <20230713080807.69999-1-frank.li@vivo.com>
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.
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/mmc/host/atmel-mci.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index dd18440a90c5..b4ae9aa939a5 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2600,7 +2600,7 @@ static int atmci_probe(struct platform_device *pdev)
return ret;
}
-static int atmci_remove(struct platform_device *pdev)
+static void atmci_remove(struct platform_device *pdev)
{
struct atmel_mci *host = platform_get_drvdata(pdev);
unsigned int i;
@@ -2630,8 +2630,6 @@ static int atmci_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
-
- return 0;
}
#ifdef CONFIG_PM
@@ -2664,7 +2662,7 @@ static const struct dev_pm_ops atmci_dev_pm_ops = {
static struct platform_driver atmci_driver = {
.probe = atmci_probe,
- .remove = atmci_remove,
+ .remove_new = atmci_remove,
.driver = {
.name = "atmel_mci",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.39.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-13 8:10 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 8:07 [PATCH 01/58] mmc: sunxi: Convert to platform remove callback returning void Yangtao Li
2023-07-13 8:07 ` [PATCH 02/58] mmc: bcm2835: " Yangtao Li
2023-07-14 10:10 ` Florian Fainelli
2023-07-13 8:07 ` [PATCH 05/58] mmc: mtk-sd: " Yangtao Li
2023-07-13 8:07 ` [PATCH 10/58] mmc: sdhci: milbeaut: " Yangtao Li
2023-07-13 8:07 ` [PATCH 12/58] mmc: sdhci-of-at91: " Yangtao Li
2023-07-13 8:07 ` [PATCH 14/58] mmc: dw_mmc: exynos: " Yangtao Li
2023-07-13 8:11 ` Krzysztof Kozlowski
2023-07-13 9:02 ` Uwe Kleine-König
2023-07-13 8:07 ` [PATCH 18/58] mmc: meson-gx: " Yangtao Li
2023-07-13 8:07 ` [PATCH 21/58] mmc: meson-mx-sdhc: " Yangtao Li
2023-07-13 8:07 ` [PATCH 23/58] mmc: mxs-mmc: " Yangtao Li
2023-07-13 8:07 ` [PATCH 25/58] mmc: uniphier-sd: " Yangtao Li
2023-07-13 9:09 ` Uwe Kleine-König
2023-07-13 8:07 ` [PATCH 27/58] mmc: sdhci-of-arasan: " Yangtao Li
2023-07-13 8:07 ` [PATCH 34/58] mmc: sdhci-of-aspeed: " Yangtao Li
2023-07-13 9:13 ` Uwe Kleine-König
2023-07-13 8:07 ` [PATCH 35/58] mmc: meson-mx-sdio: " Yangtao Li
2023-07-13 8:07 ` [PATCH 39/58] mmc: sdhci-esdhc-imx: " Yangtao Li
2023-07-13 8:07 ` [PATCH 42/58] mmc: dw_mmc: rockchip: " Yangtao Li
2023-07-13 8:07 ` [PATCH 43/58] mmc: owl: " Yangtao Li
2023-07-13 8:07 ` Yangtao Li [this message]
2023-07-13 8:07 ` [PATCH 47/58] mmc: sdhci-st: " Yangtao Li
2023-07-13 8:07 ` [PATCH 48/58] mmc: wmt-sdmmc: " Yangtao Li
2023-07-13 8:08 ` [PATCH 58/58] mmc: " Yangtao Li
2023-07-14 7:49 ` Adrian Hunter
2023-07-14 10:12 ` Florian Fainelli
2023-07-13 15:13 ` [PATCH 01/58] mmc: sunxi: " Jernej Škrabec
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=20230713080807.69999-46-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nicolas.ferre@microchip.com \
--cc=u.kleine-koenig@pengutronix.de \
--cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox