From: Yangtao Li <frank.li@vivo.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.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-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH 21/58] mmc: meson-mx-sdhc: Convert to platform remove callback returning void
Date: Thu, 13 Jul 2023 16:07:30 +0800 [thread overview]
Message-ID: <20230713080807.69999-21-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/meson-mx-sdhc-mmc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c
index 97168cdfa8e9..528ec8166e7c 100644
--- a/drivers/mmc/host/meson-mx-sdhc-mmc.c
+++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c
@@ -880,7 +880,7 @@ static int meson_mx_sdhc_probe(struct platform_device *pdev)
return ret;
}
-static int meson_mx_sdhc_remove(struct platform_device *pdev)
+static void meson_mx_sdhc_remove(struct platform_device *pdev)
{
struct meson_mx_sdhc_host *host = platform_get_drvdata(pdev);
@@ -889,8 +889,6 @@ static int meson_mx_sdhc_remove(struct platform_device *pdev)
meson_mx_sdhc_disable_clks(host->mmc);
clk_disable_unprepare(host->pclk);
-
- return 0;
}
static const struct meson_mx_sdhc_data meson_mx_sdhc_data_meson8 = {
@@ -925,7 +923,7 @@ MODULE_DEVICE_TABLE(of, meson_mx_sdhc_of_match);
static struct platform_driver meson_mx_sdhc_driver = {
.probe = meson_mx_sdhc_probe,
- .remove = meson_mx_sdhc_remove,
+ .remove_new = meson_mx_sdhc_remove,
.driver = {
.name = "meson-mx-sdhc",
.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:09 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 ` Yangtao Li [this message]
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 ` [PATCH 46/58] mmc: atmel-mci: " Yangtao Li
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-21-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).