linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 01/62] mmc: sunxi: Convert to platform remove callback returning void
@ 2023-07-27  6:59 Yangtao Li
  2023-07-27  6:59 ` [PATCH v3 02/62] mmc: bcm2835: " Yangtao Li
                   ` (20 more replies)
  0 siblings, 21 replies; 28+ messages in thread
From: Yangtao Li @ 2023-07-27  6:59 UTC (permalink / raw)
  To: Ulf Hansson, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
  Cc: Yangtao Li, Uwe Kleine-König, linux-mmc, linux-arm-kernel,
	linux-sunxi, linux-kernel

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>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
---
 drivers/mmc/host/sunxi-mmc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 69dcb8805e05..d3bd0ac99ec4 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1486,7 +1486,7 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sunxi_mmc_remove(struct platform_device *pdev)
+static void sunxi_mmc_remove(struct platform_device *pdev)
 {
 	struct mmc_host	*mmc = platform_get_drvdata(pdev);
 	struct sunxi_mmc_host *host = mmc_priv(mmc);
@@ -1499,8 +1499,6 @@ static int sunxi_mmc_remove(struct platform_device *pdev)
 	}
 	dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
 	mmc_free_host(mmc);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM
@@ -1556,7 +1554,7 @@ static struct platform_driver sunxi_mmc_driver = {
 		.pm = &sunxi_mmc_pm_ops,
 	},
 	.probe		= sunxi_mmc_probe,
-	.remove		= sunxi_mmc_remove,
+	.remove_new	= sunxi_mmc_remove,
 };
 module_platform_driver(sunxi_mmc_driver);
 
-- 
2.39.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2023-08-28  9:11 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27  6:59 [PATCH v3 01/62] mmc: sunxi: Convert to platform remove callback returning void Yangtao Li
2023-07-27  6:59 ` [PATCH v3 02/62] mmc: bcm2835: " Yangtao Li
2023-07-27  6:59 ` [PATCH v3 05/62] mmc: mtk-sd: " Yangtao Li
2023-07-27  6:59 ` [PATCH v3 10/62] mmc: sdhci: milbeaut: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 12/62] mmc: sdhci-of-at91: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 14/62] mmc: dw_mmc: exynos: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 19/62] mmc: meson-gx: " Yangtao Li
2023-07-29 19:01   ` Martin Blumenstingl
2023-07-27  7:00 ` [PATCH v3 22/62] mmc: meson-mx-sdhc: " Yangtao Li
2023-07-29 19:01   ` Martin Blumenstingl
2023-07-27  7:00 ` [PATCH v3 24/62] mmc: mxs-mmc: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 25/62] mmc: sdhci-of-arasan: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 32/62] mmc: sdhci-of-aspeed: remove unneeded variables Yangtao Li
2023-07-27  7:00 ` [PATCH v3 33/62] mmc: sdhci-of-aspeed: Convert to platform remove Yangtao Li
2023-07-27  7:00 ` [PATCH v3 34/62] mmc: meson-mx-sdio: Convert to platform remove callback returning void Yangtao Li
2023-07-29 19:02   ` Martin Blumenstingl
2023-07-27  7:00 ` [PATCH v3 38/62] mmc: sdhci-esdhc-imx: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 41/62] mmc: dw_mmc: rockchip: " Yangtao Li
2023-07-28 18:24   ` Heiko Stuebner
2023-07-27  7:00 ` [PATCH v3 42/62] mmc: owl: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 45/62] mmc: atmel-mci: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 46/62] mmc: sdhci-st: " Yangtao Li
2023-08-28  9:10   ` Patrice CHOTARD
2023-07-27  7:00 ` [PATCH v3 47/62] mmc: wmt-sdmmc: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 57/62] mmc: " Yangtao Li
2023-07-27  7:00 ` [PATCH v3 58/62] mmc: uniphier-sd: " Yangtao Li
2023-08-07 15:26 ` [PATCH v3 01/62] mmc: sunxi: " Ulf Hansson
2023-08-15 11:40   ` Ulf Hansson

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).