linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] mfd: Convert to platform remove callback returning void
@ 2023-11-06 17:17 Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 01/18] mfd: ab8500-sysctrl: " Uwe Kleine-König
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-11-06 17:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Linus Walleij, linux-arm-kernel, kernel, Benson Leung,
	Guenter Roeck, chrome-platform, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Shawn Guo, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, Tony Lindgren, linux-omap, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32

Hello,

this series converts all platform drivers below drivers/mfd to use
.remove_new(). Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver
core doesn't (and cannot) cope for errors during remove. The only effect
of a non-zero return value in .remove() is that the driver core emits a
warning. The device is removed anyhow and an early return from .remove()
usually yields resource leaks and/or use-after-free bugs.

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

All drivers converted here already returned zero unconditionally in
.remove(), so they are converted here trivially.

Best regards
Uwe

Uwe Kleine-König (18):
  mfd: ab8500-sysctrl: Convert to platform remove callback returning
    void
  mfd: cros_ec_dev: Convert to platform remove callback returning void
  mfd: exynos-lpass: Convert to platform remove callback returning void
  mfd: fsl-imx25-tsadc: Convert to platform remove callback returning
    void
  mfd: hi655x-pmic: Convert to platform remove callback returning void
  mfd: intel-lpss-acpi: Convert to platform remove callback returning
    void
  mfd: kempld-core: Convert to platform remove callback returning void
  mfd: mcp-sa11x0: Convert to platform remove callback returning void
  mfd: mxs-lradc: Convert to platform remove callback returning void
  mfd: omap-usb-host: Convert to platform remove callback returning void
  mfd: omap-usb-tll: Convert to platform remove callback returning void
  mfd: pcf50633-adc: Convert to platform remove callback returning void
  mfd: qcom-pm8xxx: Convert to platform remove callback returning void
  mfd: sm501: Convert to platform remove callback returning void
  mfd: stm32-timers: Convert to platform remove callback returning void
  mfd: ti_am335x_tscadc: Convert to platform remove callback returning
    void
  mfd: tps65911-comparator: Convert to platform remove callback
    returning void
  mfd: twl4030-audio: Convert to platform remove callback returning void

 drivers/mfd/ab8500-sysctrl.c      | 6 ++----
 drivers/mfd/cros_ec_dev.c         | 5 ++---
 drivers/mfd/exynos-lpass.c        | 6 ++----
 drivers/mfd/fsl-imx25-tsadc.c     | 6 ++----
 drivers/mfd/hi655x-pmic.c         | 5 ++---
 drivers/mfd/intel-lpss-acpi.c     | 6 ++----
 drivers/mfd/kempld-core.c         | 6 ++----
 drivers/mfd/mcp-sa11x0.c          | 6 ++----
 drivers/mfd/mxs-lradc.c           | 6 ++----
 drivers/mfd/omap-usb-host.c       | 5 ++---
 drivers/mfd/omap-usb-tll.c        | 5 ++---
 drivers/mfd/pcf50633-adc.c        | 6 ++----
 drivers/mfd/qcom-pm8xxx.c         | 6 ++----
 drivers/mfd/sm501.c               | 6 ++----
 drivers/mfd/stm32-timers.c        | 6 ++----
 drivers/mfd/ti_am335x_tscadc.c    | 6 ++----
 drivers/mfd/tps65911-comparator.c | 6 ++----
 drivers/mfd/twl4030-audio.c       | 6 ++----
 18 files changed, 36 insertions(+), 68 deletions(-)

base-commit: 3ff7a5781ceee3befb9224d29cef6e6a4766c5fe
-- 
2.42.0


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

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

* [PATCH 01/18] mfd: ab8500-sysctrl: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-11-06 17:17 ` Uwe Kleine-König
  2023-11-14 13:32   ` Linus Walleij
  2023-11-06 17:17 ` [PATCH 03/18] mfd: exynos-lpass: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2023-11-06 17:17 UTC (permalink / raw)
  To: Lee Jones; +Cc: Linus Walleij, linux-arm-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/mfd/ab8500-sysctrl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index eeeb62415f53..ce81fcb785d0 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -140,14 +140,12 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int ab8500_sysctrl_remove(struct platform_device *pdev)
+static void ab8500_sysctrl_remove(struct platform_device *pdev)
 {
 	sysctrl_dev = NULL;
 
 	if (pm_power_off == ab8500_power_off)
 		pm_power_off = NULL;
-
-	return 0;
 }
 
 static const struct of_device_id ab8500_sysctrl_match[] = {
@@ -161,7 +159,7 @@ static struct platform_driver ab8500_sysctrl_driver = {
 		.of_match_table = ab8500_sysctrl_match,
 	},
 	.probe = ab8500_sysctrl_probe,
-	.remove = ab8500_sysctrl_remove,
+	.remove_new = ab8500_sysctrl_remove,
 };
 
 static int __init ab8500_sysctrl_init(void)
-- 
2.42.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] 9+ messages in thread

* [PATCH 03/18] mfd: exynos-lpass: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 01/18] mfd: ab8500-sysctrl: " Uwe Kleine-König
@ 2023-11-06 17:17 ` Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 04/18] mfd: fsl-imx25-tsadc: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-11-06 17:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Krzysztof Kozlowski, Alim Akhtar, linux-arm-kernel,
	linux-samsung-soc, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/mfd/exynos-lpass.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/exynos-lpass.c b/drivers/mfd/exynos-lpass.c
index 1506d8d352b1..e58990c85ed8 100644
--- a/drivers/mfd/exynos-lpass.c
+++ b/drivers/mfd/exynos-lpass.c
@@ -137,7 +137,7 @@ static int exynos_lpass_probe(struct platform_device *pdev)
 	return devm_of_platform_populate(dev);
 }
 
-static int exynos_lpass_remove(struct platform_device *pdev)
+static void exynos_lpass_remove(struct platform_device *pdev)
 {
 	struct exynos_lpass *lpass = platform_get_drvdata(pdev);
 
@@ -146,8 +146,6 @@ static int exynos_lpass_remove(struct platform_device *pdev)
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		exynos_lpass_disable(lpass);
 	regmap_exit(lpass->top);
-
-	return 0;
 }
 
 static int __maybe_unused exynos_lpass_suspend(struct device *dev)
@@ -187,7 +185,7 @@ static struct platform_driver exynos_lpass_driver = {
 		.of_match_table	= exynos_lpass_of_match,
 	},
 	.probe	= exynos_lpass_probe,
-	.remove	= exynos_lpass_remove,
+	.remove_new = exynos_lpass_remove,
 };
 module_platform_driver(exynos_lpass_driver);
 
-- 
2.42.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] 9+ messages in thread

* [PATCH 04/18] mfd: fsl-imx25-tsadc: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 01/18] mfd: ab8500-sysctrl: " Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 03/18] mfd: exynos-lpass: " Uwe Kleine-König
@ 2023-11-06 17:17 ` Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 09/18] mfd: mxs-lradc: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-11-06 17:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team,
	linux-arm-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/mfd/fsl-imx25-tsadc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c
index 089c2ce615b6..74f38bf3778f 100644
--- a/drivers/mfd/fsl-imx25-tsadc.c
+++ b/drivers/mfd/fsl-imx25-tsadc.c
@@ -194,11 +194,9 @@ static int mx25_tsadc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mx25_tsadc_remove(struct platform_device *pdev)
+static void mx25_tsadc_remove(struct platform_device *pdev)
 {
 	mx25_tsadc_unset_irq(pdev);
-
-	return 0;
 }
 
 static const struct of_device_id mx25_tsadc_ids[] = {
@@ -213,7 +211,7 @@ static struct platform_driver mx25_tsadc_driver = {
 		.of_match_table = mx25_tsadc_ids,
 	},
 	.probe = mx25_tsadc_probe,
-	.remove = mx25_tsadc_remove,
+	.remove_new = mx25_tsadc_remove,
 };
 module_platform_driver(mx25_tsadc_driver);
 
-- 
2.42.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] 9+ messages in thread

* [PATCH 09/18] mfd: mxs-lradc: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-11-06 17:17 ` [PATCH 04/18] mfd: fsl-imx25-tsadc: " Uwe Kleine-König
@ 2023-11-06 17:17 ` Uwe Kleine-König
  2023-11-06 17:17 ` [PATCH 15/18] mfd: stm32-timers: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-11-06 17:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team,
	linux-arm-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/mfd/mxs-lradc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/mxs-lradc.c b/drivers/mfd/mxs-lradc.c
index ec1b356562b9..73893890b50a 100644
--- a/drivers/mfd/mxs-lradc.c
+++ b/drivers/mfd/mxs-lradc.c
@@ -230,13 +230,11 @@ static int mxs_lradc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int mxs_lradc_remove(struct platform_device *pdev)
+static void mxs_lradc_remove(struct platform_device *pdev)
 {
 	struct mxs_lradc *lradc = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(lradc->clk);
-
-	return 0;
 }
 
 static struct platform_driver mxs_lradc_driver = {
@@ -245,7 +243,7 @@ static struct platform_driver mxs_lradc_driver = {
 		.of_match_table = mxs_lradc_dt_ids,
 	},
 	.probe = mxs_lradc_probe,
-	.remove = mxs_lradc_remove,
+	.remove_new = mxs_lradc_remove,
 };
 module_platform_driver(mxs_lradc_driver);
 
-- 
2.42.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] 9+ messages in thread

* [PATCH 15/18] mfd: stm32-timers: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-11-06 17:17 ` [PATCH 09/18] mfd: mxs-lradc: " Uwe Kleine-König
@ 2023-11-06 17:17 ` Uwe Kleine-König
  2023-11-23 14:13 ` [PATCH 00/18] mfd: " Lee Jones
  2023-11-23 14:24 ` Lee Jones
  6 siblings, 0 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-11-06 17:17 UTC (permalink / raw)
  To: Lee Jones
  Cc: Fabrice Gasnier, Maxime Coquelin, Alexandre Torgue, linux-stm32,
	linux-arm-kernel, 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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/mfd/stm32-timers.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/stm32-timers.c b/drivers/mfd/stm32-timers.c
index a656a1c186a8..9fd13d88950c 100644
--- a/drivers/mfd/stm32-timers.c
+++ b/drivers/mfd/stm32-timers.c
@@ -306,7 +306,7 @@ static int stm32_timers_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int stm32_timers_remove(struct platform_device *pdev)
+static void stm32_timers_remove(struct platform_device *pdev)
 {
 	struct stm32_timers *ddata = platform_get_drvdata(pdev);
 
@@ -316,8 +316,6 @@ static int stm32_timers_remove(struct platform_device *pdev)
 	 */
 	of_platform_depopulate(&pdev->dev);
 	stm32_timers_dma_remove(&pdev->dev, ddata);
-
-	return 0;
 }
 
 static const struct of_device_id stm32_timers_of_match[] = {
@@ -328,7 +326,7 @@ MODULE_DEVICE_TABLE(of, stm32_timers_of_match);
 
 static struct platform_driver stm32_timers_driver = {
 	.probe = stm32_timers_probe,
-	.remove = stm32_timers_remove,
+	.remove_new = stm32_timers_remove,
 	.driver	= {
 		.name = "stm32-timers",
 		.of_match_table = stm32_timers_of_match,
-- 
2.42.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] 9+ messages in thread

* Re: [PATCH 01/18] mfd: ab8500-sysctrl: Convert to platform remove callback returning void
  2023-11-06 17:17 ` [PATCH 01/18] mfd: ab8500-sysctrl: " Uwe Kleine-König
@ 2023-11-14 13:32   ` Linus Walleij
  0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2023-11-14 13:32 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Lee Jones, linux-arm-kernel, kernel

On Mon, Nov 6, 2023 at 6:17 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> 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 ignored (apart
> from emitting a warning) 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. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

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

* Re: [PATCH 00/18] mfd: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-11-06 17:17 ` [PATCH 15/18] mfd: stm32-timers: " Uwe Kleine-König
@ 2023-11-23 14:13 ` Lee Jones
  2023-11-23 14:24 ` Lee Jones
  6 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2023-11-23 14:13 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, linux-arm-kernel, kernel, Benson Leung,
	Guenter Roeck, chrome-platform, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Shawn Guo, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, Tony Lindgren, linux-omap, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32

On Mon, 06 Nov 2023 18:17:09 +0100, Uwe Kleine-König wrote:
> this series converts all platform drivers below drivers/mfd to use
> .remove_new(). Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver
> core doesn't (and cannot) cope for errors during remove. The only effect
> of a non-zero return value in .remove() is that the driver core emits a
> warning. The device is removed anyhow and an early return from .remove()
> usually yields resource leaks and/or use-after-free bugs.
> 
> [...]

Applied, thanks!

[01/18] mfd: ab8500-sysctrl: Convert to platform remove callback returning void
        commit: 35cf346f9fa92ceb19c5d2edc4409a7d384da8ee
[02/18] mfd: cros_ec_dev: Convert to platform remove callback returning void
        commit: 981c92a1d65a7ccce2d814c66ff2deecca304672
[03/18] mfd: exynos-lpass: Convert to platform remove callback returning void
        commit: 2d859aa8e081884c0c02d738925cba23a8cfb1b8
[04/18] mfd: fsl-imx25-tsadc: Convert to platform remove callback returning void
        commit: f215b75acc85254a29404b32c871b7ff2ea8da2a
[09/18] mfd: mxs-lradc: Convert to platform remove callback returning void
        commit: beb1f9e6382f59339e118594c94ee6b5ac96f3ec
[10/18] mfd: omap-usb-host: Convert to platform remove callback returning void
        commit: 231927898ae91049aa35d237c556cc216d80e8f7
[11/18] mfd: omap-usb-tll: Convert to platform remove callback returning void
        commit: 83d4e355240147db7597ea1ce64624fcdaaee6ae
[13/18] mfd: qcom-pm8xxx: Convert to platform remove callback returning void
        commit: ae3bcd5b09e35f363aa1744d38f90fda2b40e9ca
[15/18] mfd: stm32-timers: Convert to platform remove callback returning void
        commit: aeebc47f8d479c363e24fba0201ef8dca417fe6e
[18/18] mfd: twl4030-audio: Convert to platform remove callback returning void
        commit: 3716978b584a8baaba16d64c93eb0fed0edcbc3b

--
Lee Jones [李琼斯]


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

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

* Re: [PATCH 00/18] mfd: Convert to platform remove callback returning void
  2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-11-23 14:13 ` [PATCH 00/18] mfd: " Lee Jones
@ 2023-11-23 14:24 ` Lee Jones
  6 siblings, 0 replies; 9+ messages in thread
From: Lee Jones @ 2023-11-23 14:24 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, linux-arm-kernel, kernel, Benson Leung,
	Guenter Roeck, chrome-platform, Krzysztof Kozlowski, Alim Akhtar,
	linux-samsung-soc, Shawn Guo, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, Tony Lindgren, linux-omap, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, linux-arm-msm, Fabrice Gasnier,
	Maxime Coquelin, Alexandre Torgue, linux-stm32

On Mon, 06 Nov 2023, Uwe Kleine-König wrote:

> Hello,
> 
> this series converts all platform drivers below drivers/mfd to use
> .remove_new(). Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver
> core doesn't (and cannot) cope for errors during remove. The only effect
> of a non-zero return value in .remove() is that the driver core emits a
> warning. The device is removed anyhow and an early return from .remove()
> usually yields resource leaks and/or use-after-free bugs.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> All drivers converted here already returned zero unconditionally in
> .remove(), so they are converted here trivially.
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (18):
>   mfd: ab8500-sysctrl: Convert to platform remove callback returning
>     void
>   mfd: cros_ec_dev: Convert to platform remove callback returning void
>   mfd: exynos-lpass: Convert to platform remove callback returning void
>   mfd: fsl-imx25-tsadc: Convert to platform remove callback returning
>     void
>   mfd: hi655x-pmic: Convert to platform remove callback returning void
>   mfd: intel-lpss-acpi: Convert to platform remove callback returning
>     void
>   mfd: kempld-core: Convert to platform remove callback returning void
>   mfd: mcp-sa11x0: Convert to platform remove callback returning void
>   mfd: mxs-lradc: Convert to platform remove callback returning void
>   mfd: omap-usb-host: Convert to platform remove callback returning void
>   mfd: omap-usb-tll: Convert to platform remove callback returning void
>   mfd: pcf50633-adc: Convert to platform remove callback returning void
>   mfd: qcom-pm8xxx: Convert to platform remove callback returning void
>   mfd: sm501: Convert to platform remove callback returning void
>   mfd: stm32-timers: Convert to platform remove callback returning void
>   mfd: ti_am335x_tscadc: Convert to platform remove callback returning
>     void
>   mfd: tps65911-comparator: Convert to platform remove callback
>     returning void
>   mfd: twl4030-audio: Convert to platform remove callback returning void

Looks like you missed the mailing list on a bunch of these.

I'm going to remove this set for now.

Could you please resubmit it and Cc: LKML?

>  drivers/mfd/ab8500-sysctrl.c      | 6 ++----
>  drivers/mfd/cros_ec_dev.c         | 5 ++---
>  drivers/mfd/exynos-lpass.c        | 6 ++----
>  drivers/mfd/fsl-imx25-tsadc.c     | 6 ++----
>  drivers/mfd/hi655x-pmic.c         | 5 ++---
>  drivers/mfd/intel-lpss-acpi.c     | 6 ++----
>  drivers/mfd/kempld-core.c         | 6 ++----
>  drivers/mfd/mcp-sa11x0.c          | 6 ++----
>  drivers/mfd/mxs-lradc.c           | 6 ++----
>  drivers/mfd/omap-usb-host.c       | 5 ++---
>  drivers/mfd/omap-usb-tll.c        | 5 ++---
>  drivers/mfd/pcf50633-adc.c        | 6 ++----
>  drivers/mfd/qcom-pm8xxx.c         | 6 ++----
>  drivers/mfd/sm501.c               | 6 ++----
>  drivers/mfd/stm32-timers.c        | 6 ++----
>  drivers/mfd/ti_am335x_tscadc.c    | 6 ++----
>  drivers/mfd/tps65911-comparator.c | 6 ++----
>  drivers/mfd/twl4030-audio.c       | 6 ++----
>  18 files changed, 36 insertions(+), 68 deletions(-)
> 
> base-commit: 3ff7a5781ceee3befb9224d29cef6e6a4766c5fe
> -- 
> 2.42.0
> 

-- 
Lee Jones [李琼斯]

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

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

end of thread, other threads:[~2023-11-23 14:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-06 17:17 [PATCH 00/18] mfd: Convert to platform remove callback returning void Uwe Kleine-König
2023-11-06 17:17 ` [PATCH 01/18] mfd: ab8500-sysctrl: " Uwe Kleine-König
2023-11-14 13:32   ` Linus Walleij
2023-11-06 17:17 ` [PATCH 03/18] mfd: exynos-lpass: " Uwe Kleine-König
2023-11-06 17:17 ` [PATCH 04/18] mfd: fsl-imx25-tsadc: " Uwe Kleine-König
2023-11-06 17:17 ` [PATCH 09/18] mfd: mxs-lradc: " Uwe Kleine-König
2023-11-06 17:17 ` [PATCH 15/18] mfd: stm32-timers: " Uwe Kleine-König
2023-11-23 14:13 ` [PATCH 00/18] mfd: " Lee Jones
2023-11-23 14:24 ` Lee Jones

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