All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/20] pinctrl: Convert to platform remove callback returning void
@ 2023-10-09  8:38 ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel, Yangtao Li, Andy Shevchenko,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Charles Keepax,
	Richard Fitzgerald, alsa-devel, patches, Mika Westerberg,
	Andy Shevchenko, Basavaraj Natikar, Shyam Sundar S K,
	Jesper Nilsson, Lars Persson, linux-arm-kernel, Heiko Stuebner,
	linux-rockchip, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-arm-msm, Geert Uytterhoeven, linux-renesas-soc

Hello,

after three minor improvements/simplifications this series converts all
platform_drivers below drivers/pinctrl to .remove_new().

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

The only interdependencies in this series are the patches that touch a
single driver (that is (1, 13), (2, 12), (3, 20)). As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply (or a different concern that doesn't apply to all patches), please
apply the remainder of this series anyhow. I'll come back to the part
that you (maybe) skipped at a later point.

Best regards
Uwe

Uwe Kleine-König (20):
  pinctrl: stmfx: Improve error message in .remove()'s error path
  pinctrl: single: Drop if block with always false condition
  pinctrl: ti: ti-iodelay: Drop if block with always false condition
  pinctrl: cirrus: madera-core: Convert to platform remove callback
    returning void
  pinctrl: intel: cherryview: Convert to platform remove callback
    returning void
  pinctrl: intel: lynxpoint: Convert to platform remove callback
    returning void
  pinctrl: nomadik: abx500: Convert to platform remove callback
    returning void
  pinctrl: amd: Convert to platform remove callback returning void
  pinctrl: artpec6: Convert to platform remove callback returning void
  pinctrl: as3722: Convert to platform remove callback returning void
  pinctrl: rockchip: Convert to platform remove callback returning void
  pinctrl: single: Convert to platform remove callback returning void
  pinctrl: stmfx: Convert to platform remove callback returning void
  pinctrl: tb10x: Convert to platform remove callback returning void
  pinctrl: qcom: spmi-gpio: Convert to platform remove callback
    returning void
  pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning
    void
  pinctrl: qcom: ssbi-gpio: Convert to platform remove callback
    returning void
  pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning
    void
  pinctrl: renesas: rzn1: Convert to platform remove callback returning
    void
  pinctrl: ti: ti-iodelay: Convert to platform remove callback returning
    void

 drivers/pinctrl/cirrus/pinctrl-madera-core.c |  6 ++----
 drivers/pinctrl/intel/pinctrl-cherryview.c   |  6 ++----
 drivers/pinctrl/intel/pinctrl-lynxpoint.c    |  5 ++---
 drivers/pinctrl/nomadik/pinctrl-abx500.c     |  5 ++---
 drivers/pinctrl/pinctrl-amd.c                |  6 ++----
 drivers/pinctrl/pinctrl-artpec6.c            |  6 ++----
 drivers/pinctrl/pinctrl-as3722.c             |  5 ++---
 drivers/pinctrl/pinctrl-rockchip.c           |  6 ++----
 drivers/pinctrl/pinctrl-single.c             |  9 ++-------
 drivers/pinctrl/pinctrl-stmfx.c              | 16 ++++++++++------
 drivers/pinctrl/pinctrl-tb10x.c              |  6 ++----
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c     |  5 ++---
 drivers/pinctrl/qcom/pinctrl-spmi-mpp.c      |  5 ++---
 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c     |  6 ++----
 drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c      |  6 ++----
 drivers/pinctrl/renesas/pinctrl-rzn1.c       |  6 ++----
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c      | 11 ++---------
 17 files changed, 42 insertions(+), 73 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
-- 
2.40.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH 00/20] pinctrl: Convert to platform remove callback returning void
@ 2023-10-09  8:38 ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel, Yangtao Li, Andy Shevchenko,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Charles Keepax,
	Richard Fitzgerald, alsa-devel, patches, Mika Westerberg,
	Andy Shevchenko, Basavaraj Natikar, Shyam Sundar S K,
	Jesper Nilsson, Lars Persson, linux-arm-kernel, Heiko Stuebner,
	linux-rockchip, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-arm-msm, Geert Uytterhoeven, linux-renesas-soc

Hello,

after three minor improvements/simplifications this series converts all
platform_drivers below drivers/pinctrl to .remove_new().

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

The only interdependencies in this series are the patches that touch a
single driver (that is (1, 13), (2, 12), (3, 20)). As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply (or a different concern that doesn't apply to all patches), please
apply the remainder of this series anyhow. I'll come back to the part
that you (maybe) skipped at a later point.

Best regards
Uwe

Uwe Kleine-König (20):
  pinctrl: stmfx: Improve error message in .remove()'s error path
  pinctrl: single: Drop if block with always false condition
  pinctrl: ti: ti-iodelay: Drop if block with always false condition
  pinctrl: cirrus: madera-core: Convert to platform remove callback
    returning void
  pinctrl: intel: cherryview: Convert to platform remove callback
    returning void
  pinctrl: intel: lynxpoint: Convert to platform remove callback
    returning void
  pinctrl: nomadik: abx500: Convert to platform remove callback
    returning void
  pinctrl: amd: Convert to platform remove callback returning void
  pinctrl: artpec6: Convert to platform remove callback returning void
  pinctrl: as3722: Convert to platform remove callback returning void
  pinctrl: rockchip: Convert to platform remove callback returning void
  pinctrl: single: Convert to platform remove callback returning void
  pinctrl: stmfx: Convert to platform remove callback returning void
  pinctrl: tb10x: Convert to platform remove callback returning void
  pinctrl: qcom: spmi-gpio: Convert to platform remove callback
    returning void
  pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning
    void
  pinctrl: qcom: ssbi-gpio: Convert to platform remove callback
    returning void
  pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning
    void
  pinctrl: renesas: rzn1: Convert to platform remove callback returning
    void
  pinctrl: ti: ti-iodelay: Convert to platform remove callback returning
    void

 drivers/pinctrl/cirrus/pinctrl-madera-core.c |  6 ++----
 drivers/pinctrl/intel/pinctrl-cherryview.c   |  6 ++----
 drivers/pinctrl/intel/pinctrl-lynxpoint.c    |  5 ++---
 drivers/pinctrl/nomadik/pinctrl-abx500.c     |  5 ++---
 drivers/pinctrl/pinctrl-amd.c                |  6 ++----
 drivers/pinctrl/pinctrl-artpec6.c            |  6 ++----
 drivers/pinctrl/pinctrl-as3722.c             |  5 ++---
 drivers/pinctrl/pinctrl-rockchip.c           |  6 ++----
 drivers/pinctrl/pinctrl-single.c             |  9 ++-------
 drivers/pinctrl/pinctrl-stmfx.c              | 16 ++++++++++------
 drivers/pinctrl/pinctrl-tb10x.c              |  6 ++----
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c     |  5 ++---
 drivers/pinctrl/qcom/pinctrl-spmi-mpp.c      |  5 ++---
 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c     |  6 ++----
 drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c      |  6 ++----
 drivers/pinctrl/renesas/pinctrl-rzn1.c       |  6 ++----
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c      | 11 ++---------
 17 files changed, 42 insertions(+), 73 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
-- 
2.40.1


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

* [PATCH 00/20] pinctrl: Convert to platform remove callback returning void
@ 2023-10-09  8:38 ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel, Yangtao Li, Andy Shevchenko,
	Maxime Coquelin, Alexandre Torgue, linux-stm32, Charles Keepax,
	Richard Fitzgerald, alsa-devel, patches, Mika Westerberg,
	Andy Shevchenko, Basavaraj Natikar, Shyam Sundar S K,
	Jesper Nilsson, Lars Persson, linux-arm-kernel, Heiko Stuebner,
	linux-rockchip, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-arm-msm, Geert Uytterhoeven, linux-renesas-soc

Hello,

after three minor improvements/simplifications this series converts all
platform_drivers below drivers/pinctrl to .remove_new().

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

The only interdependencies in this series are the patches that touch a
single driver (that is (1, 13), (2, 12), (3, 20)). As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply (or a different concern that doesn't apply to all patches), please
apply the remainder of this series anyhow. I'll come back to the part
that you (maybe) skipped at a later point.

Best regards
Uwe

Uwe Kleine-König (20):
  pinctrl: stmfx: Improve error message in .remove()'s error path
  pinctrl: single: Drop if block with always false condition
  pinctrl: ti: ti-iodelay: Drop if block with always false condition
  pinctrl: cirrus: madera-core: Convert to platform remove callback
    returning void
  pinctrl: intel: cherryview: Convert to platform remove callback
    returning void
  pinctrl: intel: lynxpoint: Convert to platform remove callback
    returning void
  pinctrl: nomadik: abx500: Convert to platform remove callback
    returning void
  pinctrl: amd: Convert to platform remove callback returning void
  pinctrl: artpec6: Convert to platform remove callback returning void
  pinctrl: as3722: Convert to platform remove callback returning void
  pinctrl: rockchip: Convert to platform remove callback returning void
  pinctrl: single: Convert to platform remove callback returning void
  pinctrl: stmfx: Convert to platform remove callback returning void
  pinctrl: tb10x: Convert to platform remove callback returning void
  pinctrl: qcom: spmi-gpio: Convert to platform remove callback
    returning void
  pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning
    void
  pinctrl: qcom: ssbi-gpio: Convert to platform remove callback
    returning void
  pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning
    void
  pinctrl: renesas: rzn1: Convert to platform remove callback returning
    void
  pinctrl: ti: ti-iodelay: Convert to platform remove callback returning
    void

 drivers/pinctrl/cirrus/pinctrl-madera-core.c |  6 ++----
 drivers/pinctrl/intel/pinctrl-cherryview.c   |  6 ++----
 drivers/pinctrl/intel/pinctrl-lynxpoint.c    |  5 ++---
 drivers/pinctrl/nomadik/pinctrl-abx500.c     |  5 ++---
 drivers/pinctrl/pinctrl-amd.c                |  6 ++----
 drivers/pinctrl/pinctrl-artpec6.c            |  6 ++----
 drivers/pinctrl/pinctrl-as3722.c             |  5 ++---
 drivers/pinctrl/pinctrl-rockchip.c           |  6 ++----
 drivers/pinctrl/pinctrl-single.c             |  9 ++-------
 drivers/pinctrl/pinctrl-stmfx.c              | 16 ++++++++++------
 drivers/pinctrl/pinctrl-tb10x.c              |  6 ++----
 drivers/pinctrl/qcom/pinctrl-spmi-gpio.c     |  5 ++---
 drivers/pinctrl/qcom/pinctrl-spmi-mpp.c      |  5 ++---
 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c     |  6 ++----
 drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c      |  6 ++----
 drivers/pinctrl/renesas/pinctrl-rzn1.c       |  6 ++----
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c      | 11 ++---------
 17 files changed, 42 insertions(+), 73 deletions(-)


base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path
  2023-10-09  8:38 ` Uwe Kleine-König
@ 2023-10-09  8:38   ` Uwe Kleine-König
  -1 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel

The driver core has no handling for errors returned by the .remove()
callback. The only action on error is a dev_warn() with generic error
message that the returned value is returned.

Replace it by a more specific and useful message. Then returning zero is
the right thing to do, the only effect is to suppress the core's
warning.

This prepares the driver for the conversion to .remove_new().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/pinctrl-stmfx.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index 0974bbf57b54..d7ab82432a52 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -737,11 +737,17 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
 static int stmfx_pinctrl_remove(struct platform_device *pdev)
 {
 	struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
+	int ret;
 
-	return stmfx_function_disable(stmfx,
-				      STMFX_FUNC_GPIO |
-				      STMFX_FUNC_ALTGPIO_LOW |
-				      STMFX_FUNC_ALTGPIO_HIGH);
+	ret = stmfx_function_disable(stmfx,
+				     STMFX_FUNC_GPIO |
+				     STMFX_FUNC_ALTGPIO_LOW |
+				     STMFX_FUNC_ALTGPIO_HIGH);
+	if (ret)
+		dev_err(&pdev->dev, "Failed to disable pins (%pe)\n",
+			ERR_PTR(ret));
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.40.1


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

* [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel

The driver core has no handling for errors returned by the .remove()
callback. The only action on error is a dev_warn() with generic error
message that the returned value is returned.

Replace it by a more specific and useful message. Then returning zero is
the right thing to do, the only effect is to suppress the core's
warning.

This prepares the driver for the conversion to .remove_new().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/pinctrl-stmfx.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index 0974bbf57b54..d7ab82432a52 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -737,11 +737,17 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
 static int stmfx_pinctrl_remove(struct platform_device *pdev)
 {
 	struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
+	int ret;
 
-	return stmfx_function_disable(stmfx,
-				      STMFX_FUNC_GPIO |
-				      STMFX_FUNC_ALTGPIO_LOW |
-				      STMFX_FUNC_ALTGPIO_HIGH);
+	ret = stmfx_function_disable(stmfx,
+				     STMFX_FUNC_GPIO |
+				     STMFX_FUNC_ALTGPIO_LOW |
+				     STMFX_FUNC_ALTGPIO_HIGH);
+	if (ret)
+		dev_err(&pdev->dev, "Failed to disable pins (%pe)\n",
+			ERR_PTR(ret));
+
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 02/20] pinctrl: single: Drop if block with always false condition
  2023-10-09  8:38 ` Uwe Kleine-König
@ 2023-10-09  8:38   ` Uwe Kleine-König
  -1 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel

pcs_remove() is only called after pcs_probe() completed successfully. In
this case platform_set_drvdata() was called with a non-NULL argument and
so platform_get_drvdata() won't return NULL.

Simplify by removing the if block with the always false condition.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/pinctrl-single.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 461a7c02d4a3..f6c02c8b934d 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1929,9 +1929,6 @@ static int pcs_remove(struct platform_device *pdev)
 {
 	struct pcs_device *pcs = platform_get_drvdata(pdev);
 
-	if (!pcs)
-		return 0;
-
 	pcs_free_resources(pcs);
 
 	return 0;
-- 
2.40.1


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

* [PATCH 02/20] pinctrl: single: Drop if block with always false condition
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel

pcs_remove() is only called after pcs_probe() completed successfully. In
this case platform_set_drvdata() was called with a non-NULL argument and
so platform_get_drvdata() won't return NULL.

Simplify by removing the if block with the always false condition.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/pinctrl-single.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 461a7c02d4a3..f6c02c8b934d 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1929,9 +1929,6 @@ static int pcs_remove(struct platform_device *pdev)
 {
 	struct pcs_device *pcs = platform_get_drvdata(pdev);
 
-	if (!pcs)
-		return 0;
-
 	pcs_free_resources(pcs);
 
 	return 0;
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 03/20] pinctrl: ti: ti-iodelay: Drop if block with always false condition
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (3 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:36   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Yangtao Li, Andy Shevchenko, linux-gpio, linux-kernel

ti_iodelay_remove() is only called after ti_iodelay_probe() completed
successfully. In this case platform_set_drvdata() was called with a
non-NULL argument and so platform_get_drvdata() won't return NULL.

Simplify by removing the if block with the always false condition.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index c1477f657839..f3a273562095 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -903,9 +903,6 @@ static int ti_iodelay_remove(struct platform_device *pdev)
 {
 	struct ti_iodelay_device *iod = platform_get_drvdata(pdev);
 
-	if (!iod)
-		return 0;
-
 	if (iod->pctl)
 		pinctrl_unregister(iod->pctl);
 
-- 
2.40.1


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

* [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (4 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-09 10:37   ` Charles Keepax
  2023-10-10 13:37   ` Linus Walleij
  -1 siblings, 2 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Charles Keepax, Richard Fitzgerald, alsa-devel, patches,
	linux-gpio, 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 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/pinctrl/cirrus/pinctrl-madera-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
index bb589922d8c5..898b197c3738 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c
+++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
@@ -1084,19 +1084,17 @@ static int madera_pin_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int madera_pin_remove(struct platform_device *pdev)
+static void madera_pin_remove(struct platform_device *pdev)
 {
 	struct madera_pin_private *priv = platform_get_drvdata(pdev);
 
 	if (priv->madera->pdata.gpio_configs)
 		pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
-
-	return 0;
 }
 
 static struct platform_driver madera_pin_driver = {
 	.probe = madera_pin_probe,
-	.remove = madera_pin_remove,
+	.remove_new = madera_pin_remove,
 	.driver = {
 		.name = "madera-pinctrl",
 	},
-- 
2.40.1


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

* [PATCH 05/20] pinctrl: intel: cherryview: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (5 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-09 11:10   ` Mika Westerberg
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Mika Westerberg, Andy Shevchenko, linux-gpio, 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 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/pinctrl/intel/pinctrl-cherryview.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index 81ee949b946d..1f923a895987 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1728,7 +1728,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int chv_pinctrl_remove(struct platform_device *pdev)
+static void chv_pinctrl_remove(struct platform_device *pdev)
 {
 	struct intel_pinctrl *pctrl = platform_get_drvdata(pdev);
 	const struct intel_community *community = &pctrl->communities[0];
@@ -1736,8 +1736,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev)
 	acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev),
 					  community->acpi_space_id,
 					  chv_pinctrl_mmio_access_handler);
-
-	return 0;
 }
 
 static int chv_pinctrl_suspend_noirq(struct device *dev)
@@ -1835,7 +1833,7 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match);
 
 static struct platform_driver chv_pinctrl_driver = {
 	.probe = chv_pinctrl_probe,
-	.remove = chv_pinctrl_remove,
+	.remove_new = chv_pinctrl_remove,
 	.driver = {
 		.name = "cherryview-pinctrl",
 		.pm = pm_sleep_ptr(&chv_pinctrl_pm_ops),
-- 
2.40.1


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

* [PATCH 06/20] pinctrl: intel: lynxpoint: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (6 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-09 11:10   ` Mika Westerberg
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Mika Westerberg, Andy Shevchenko, linux-gpio, 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 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/pinctrl/intel/pinctrl-lynxpoint.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
index c3732a9f0658..f0725edcab3b 100644
--- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c
+++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c
@@ -846,10 +846,9 @@ static int lp_gpio_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int lp_gpio_remove(struct platform_device *pdev)
+static void lp_gpio_remove(struct platform_device *pdev)
 {
 	pm_runtime_disable(&pdev->dev);
-	return 0;
 }
 
 static int lp_gpio_runtime_suspend(struct device *dev)
@@ -890,7 +889,7 @@ MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match);
 
 static struct platform_driver lp_gpio_driver = {
 	.probe          = lp_gpio_probe,
-	.remove         = lp_gpio_remove,
+	.remove_new     = lp_gpio_remove,
 	.driver         = {
 		.name   = "lp_gpio",
 		.pm	= pm_ptr(&lp_gpio_pm_ops),
-- 
2.40.1


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

* [PATCH 07/20] pinctrl: nomadik: abx500: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
@ 2023-10-09  8:38   ` Uwe Kleine-König
  -1 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-arm-kernel, linux-gpio, 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 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/pinctrl/nomadik/pinctrl-abx500.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index 6b90051af206..233857d54403 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -1079,12 +1079,11 @@ static int abx500_gpio_probe(struct platform_device *pdev)
  * abx500_gpio_remove() - remove Ab8500-gpio driver
  * @pdev:	Platform device registered
  */
-static int abx500_gpio_remove(struct platform_device *pdev)
+static void abx500_gpio_remove(struct platform_device *pdev)
 {
 	struct abx500_pinctrl *pct = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&pct->chip);
-	return 0;
 }
 
 static struct platform_driver abx500_gpio_driver = {
@@ -1093,7 +1092,7 @@ static struct platform_driver abx500_gpio_driver = {
 		.of_match_table = abx500_gpio_match,
 	},
 	.probe = abx500_gpio_probe,
-	.remove = abx500_gpio_remove,
+	.remove_new = abx500_gpio_remove,
 };
 
 static int __init abx500_gpio_init(void)
-- 
2.40.1


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

* [PATCH 07/20] pinctrl: nomadik: abx500: Convert to platform remove callback returning void
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-arm-kernel, linux-gpio, 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 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/pinctrl/nomadik/pinctrl-abx500.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index 6b90051af206..233857d54403 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -1079,12 +1079,11 @@ static int abx500_gpio_probe(struct platform_device *pdev)
  * abx500_gpio_remove() - remove Ab8500-gpio driver
  * @pdev:	Platform device registered
  */
-static int abx500_gpio_remove(struct platform_device *pdev)
+static void abx500_gpio_remove(struct platform_device *pdev)
 {
 	struct abx500_pinctrl *pct = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&pct->chip);
-	return 0;
 }
 
 static struct platform_driver abx500_gpio_driver = {
@@ -1093,7 +1092,7 @@ static struct platform_driver abx500_gpio_driver = {
 		.of_match_table = abx500_gpio_match,
 	},
 	.probe = abx500_gpio_probe,
-	.remove = abx500_gpio_remove,
+	.remove_new = abx500_gpio_remove,
 };
 
 static int __init abx500_gpio_init(void)
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 08/20] pinctrl: amd: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (8 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:38   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Basavaraj Natikar, Shyam Sundar S K, linux-gpio, 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 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/pinctrl/pinctrl-amd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 74241b2ff21e..fb58acb843d9 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -1166,7 +1166,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int amd_gpio_remove(struct platform_device *pdev)
+static void amd_gpio_remove(struct platform_device *pdev)
 {
 	struct amd_gpio *gpio_dev;
 
@@ -1174,8 +1174,6 @@ static int amd_gpio_remove(struct platform_device *pdev)
 
 	gpiochip_remove(&gpio_dev->gc);
 	acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_ACPI
@@ -1197,7 +1195,7 @@ static struct platform_driver amd_gpio_driver = {
 #endif
 	},
 	.probe		= amd_gpio_probe,
-	.remove		= amd_gpio_remove,
+	.remove_new	= amd_gpio_remove,
 };
 
 module_platform_driver(amd_gpio_driver);
-- 
2.40.1


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

* [PATCH 09/20] pinctrl: artpec6: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (9 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10  8:40   ` Jesper Nilsson
  2023-10-10 13:39   ` Linus Walleij
  -1 siblings, 2 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Jesper Nilsson, Lars Persson, linux-arm-kernel, linux-gpio, 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 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/pinctrl/pinctrl-artpec6.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index d6c9f9dcff97..dd93f124e0a0 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -970,13 +970,11 @@ static int artpec6_pmx_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int artpec6_pmx_remove(struct platform_device *pdev)
+static void artpec6_pmx_remove(struct platform_device *pdev)
 {
 	struct artpec6_pmx *pmx = platform_get_drvdata(pdev);
 
 	pinctrl_unregister(pmx->pctl);
-
-	return 0;
 }
 
 static const struct of_device_id artpec6_pinctrl_match[] = {
@@ -990,7 +988,7 @@ static struct platform_driver artpec6_pmx_driver = {
 		.of_match_table = artpec6_pinctrl_match,
 	},
 	.probe = artpec6_pmx_probe,
-	.remove = artpec6_pmx_remove,
+	.remove_new = artpec6_pmx_remove,
 };
 
 static int __init artpec6_pmx_init(void)
-- 
2.40.1


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

* [PATCH 10/20] pinctrl: as3722: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (10 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:39   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, 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 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/pinctrl/pinctrl-as3722.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c
index f0e5d87ac50b..84b47a6cc3a6 100644
--- a/drivers/pinctrl/pinctrl-as3722.c
+++ b/drivers/pinctrl/pinctrl-as3722.c
@@ -587,12 +587,11 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int as3722_pinctrl_remove(struct platform_device *pdev)
+static void as3722_pinctrl_remove(struct platform_device *pdev)
 {
 	struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&as_pci->gpio_chip);
-	return 0;
 }
 
 static const struct of_device_id as3722_pinctrl_of_match[] = {
@@ -607,7 +606,7 @@ static struct platform_driver as3722_pinctrl_driver = {
 		.of_match_table = as3722_pinctrl_of_match,
 	},
 	.probe = as3722_pinctrl_probe,
-	.remove = as3722_pinctrl_remove,
+	.remove_new = as3722_pinctrl_remove,
 };
 module_platform_driver(as3722_pinctrl_driver);
 
-- 
2.40.1


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

* [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
  (?)
@ 2023-10-09  8:38   ` Uwe Kleine-König
  -1 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
	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 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/pinctrl/pinctrl-rockchip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 45e416f68e74..3bedf36a0019 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rockchip_pinctrl_remove(struct platform_device *pdev)
+static void rockchip_pinctrl_remove(struct platform_device *pdev)
 {
 	struct rockchip_pinctrl *info = platform_get_drvdata(pdev);
 	struct rockchip_pin_bank *bank;
@@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev)
 		}
 		mutex_unlock(&bank->deferred_lock);
 	}
-
-	return 0;
 }
 
 static struct rockchip_pin_bank px30_pin_banks[] = {
@@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
 
 static struct platform_driver rockchip_pinctrl_driver = {
 	.probe		= rockchip_pinctrl_probe,
-	.remove		= rockchip_pinctrl_remove,
+	.remove_new	= rockchip_pinctrl_remove,
 	.driver = {
 		.name	= "rockchip-pinctrl",
 		.pm = &rockchip_pinctrl_dev_pm_ops,
-- 
2.40.1


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

* [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
	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 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/pinctrl/pinctrl-rockchip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 45e416f68e74..3bedf36a0019 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rockchip_pinctrl_remove(struct platform_device *pdev)
+static void rockchip_pinctrl_remove(struct platform_device *pdev)
 {
 	struct rockchip_pinctrl *info = platform_get_drvdata(pdev);
 	struct rockchip_pin_bank *bank;
@@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev)
 		}
 		mutex_unlock(&bank->deferred_lock);
 	}
-
-	return 0;
 }
 
 static struct rockchip_pin_bank px30_pin_banks[] = {
@@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
 
 static struct platform_driver rockchip_pinctrl_driver = {
 	.probe		= rockchip_pinctrl_probe,
-	.remove		= rockchip_pinctrl_remove,
+	.remove_new	= rockchip_pinctrl_remove,
 	.driver = {
 		.name	= "rockchip-pinctrl",
 		.pm = &rockchip_pinctrl_dev_pm_ops,
-- 
2.40.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
	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 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/pinctrl/pinctrl-rockchip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 45e416f68e74..3bedf36a0019 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rockchip_pinctrl_remove(struct platform_device *pdev)
+static void rockchip_pinctrl_remove(struct platform_device *pdev)
 {
 	struct rockchip_pinctrl *info = platform_get_drvdata(pdev);
 	struct rockchip_pin_bank *bank;
@@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev)
 		}
 		mutex_unlock(&bank->deferred_lock);
 	}
-
-	return 0;
 }
 
 static struct rockchip_pin_bank px30_pin_banks[] = {
@@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
 
 static struct platform_driver rockchip_pinctrl_driver = {
 	.probe		= rockchip_pinctrl_probe,
-	.remove		= rockchip_pinctrl_remove,
+	.remove_new	= rockchip_pinctrl_remove,
 	.driver = {
 		.name	= "rockchip-pinctrl",
 		.pm = &rockchip_pinctrl_dev_pm_ops,
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 12/20] pinctrl: single: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
@ 2023-10-09  8:38   ` Uwe Kleine-König
  -1 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, 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 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/pinctrl/pinctrl-single.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index f6c02c8b934d..1f915269d347 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1925,13 +1925,11 @@ static int pcs_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pcs_remove(struct platform_device *pdev)
+static void pcs_remove(struct platform_device *pdev)
 {
 	struct pcs_device *pcs = platform_get_drvdata(pdev);
 
 	pcs_free_resources(pcs);
-
-	return 0;
 }
 
 static const struct pcs_soc_data pinctrl_single_omap_wkup = {
@@ -1979,7 +1977,7 @@ MODULE_DEVICE_TABLE(of, pcs_of_match);
 
 static struct platform_driver pcs_driver = {
 	.probe		= pcs_probe,
-	.remove		= pcs_remove,
+	.remove_new	= pcs_remove,
 	.driver = {
 		.name		= DRIVER_NAME,
 		.of_match_table	= pcs_of_match,
-- 
2.40.1


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

* [PATCH 12/20] pinctrl: single: Convert to platform remove callback returning void
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, 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 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/pinctrl/pinctrl-single.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index f6c02c8b934d..1f915269d347 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1925,13 +1925,11 @@ static int pcs_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pcs_remove(struct platform_device *pdev)
+static void pcs_remove(struct platform_device *pdev)
 {
 	struct pcs_device *pcs = platform_get_drvdata(pdev);
 
 	pcs_free_resources(pcs);
-
-	return 0;
 }
 
 static const struct pcs_soc_data pinctrl_single_omap_wkup = {
@@ -1979,7 +1977,7 @@ MODULE_DEVICE_TABLE(of, pcs_of_match);
 
 static struct platform_driver pcs_driver = {
 	.probe		= pcs_probe,
-	.remove		= pcs_remove,
+	.remove_new	= pcs_remove,
 	.driver = {
 		.name		= DRIVER_NAME,
 		.of_match_table	= pcs_of_match,
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 13/20] pinctrl: stmfx: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
@ 2023-10-09  8:38   ` Uwe Kleine-König
  -1 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, 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 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/pinctrl/pinctrl-stmfx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index d7ab82432a52..6313be370eb7 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -734,7 +734,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int stmfx_pinctrl_remove(struct platform_device *pdev)
+static void stmfx_pinctrl_remove(struct platform_device *pdev)
 {
 	struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
 	int ret;
@@ -746,8 +746,6 @@ static int stmfx_pinctrl_remove(struct platform_device *pdev)
 	if (ret)
 		dev_err(&pdev->dev, "Failed to disable pins (%pe)\n",
 			ERR_PTR(ret));
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -856,7 +854,7 @@ static struct platform_driver stmfx_pinctrl_driver = {
 		.pm = &stmfx_pinctrl_dev_pm_ops,
 	},
 	.probe = stmfx_pinctrl_probe,
-	.remove = stmfx_pinctrl_remove,
+	.remove_new = stmfx_pinctrl_remove,
 };
 module_platform_driver(stmfx_pinctrl_driver);
 
-- 
2.40.1


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

* [PATCH 13/20] pinctrl: stmfx: Convert to platform remove callback returning void
@ 2023-10-09  8:38   ` Uwe Kleine-König
  0 siblings, 0 replies; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, 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 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/pinctrl/pinctrl-stmfx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index d7ab82432a52..6313be370eb7 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -734,7 +734,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int stmfx_pinctrl_remove(struct platform_device *pdev)
+static void stmfx_pinctrl_remove(struct platform_device *pdev)
 {
 	struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);
 	int ret;
@@ -746,8 +746,6 @@ static int stmfx_pinctrl_remove(struct platform_device *pdev)
 	if (ret)
 		dev_err(&pdev->dev, "Failed to disable pins (%pe)\n",
 			ERR_PTR(ret));
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -856,7 +854,7 @@ static struct platform_driver stmfx_pinctrl_driver = {
 		.pm = &stmfx_pinctrl_dev_pm_ops,
 	},
 	.probe = stmfx_pinctrl_probe,
-	.remove = stmfx_pinctrl_remove,
+	.remove_new = stmfx_pinctrl_remove,
 };
 module_platform_driver(stmfx_pinctrl_driver);
 
-- 
2.40.1


_______________________________________________
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] 67+ messages in thread

* [PATCH 14/20] pinctrl: tb10x: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (14 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:42   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, 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 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/pinctrl/pinctrl-tb10x.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c
index ab49bd708969..c3b76e6511ac 100644
--- a/drivers/pinctrl/pinctrl-tb10x.c
+++ b/drivers/pinctrl/pinctrl-tb10x.c
@@ -804,13 +804,11 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tb10x_pinctrl_remove(struct platform_device *pdev)
+static void tb10x_pinctrl_remove(struct platform_device *pdev)
 {
 	struct tb10x_pinctrl *state = platform_get_drvdata(pdev);
 
 	mutex_destroy(&state->mutex);
-
-	return 0;
 }
 
 
@@ -822,7 +820,7 @@ MODULE_DEVICE_TABLE(of, tb10x_pinctrl_dt_ids);
 
 static struct platform_driver tb10x_pinctrl_pdrv = {
 	.probe   = tb10x_pinctrl_probe,
-	.remove  = tb10x_pinctrl_remove,
+	.remove_new = tb10x_pinctrl_remove,
 	.driver  = {
 		.name  = "tb10x_pinctrl",
 		.of_match_table = of_match_ptr(tb10x_pinctrl_dt_ids),
-- 
2.40.1


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

* [PATCH 15/20] pinctrl: qcom: spmi-gpio: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (15 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:42   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-gpio, 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 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/pinctrl/qcom/pinctrl-spmi-gpio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
index deded9c6fd7d..f4e2c88a7c82 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
@@ -1185,12 +1185,11 @@ static int pmic_gpio_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pmic_gpio_remove(struct platform_device *pdev)
+static void pmic_gpio_remove(struct platform_device *pdev)
 {
 	struct pmic_gpio_state *state = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&state->chip);
-	return 0;
 }
 
 static const struct of_device_id pmic_gpio_of_match[] = {
@@ -1265,7 +1264,7 @@ static struct platform_driver pmic_gpio_driver = {
 		   .of_match_table = pmic_gpio_of_match,
 	},
 	.probe	= pmic_gpio_probe,
-	.remove = pmic_gpio_remove,
+	.remove_new = pmic_gpio_remove,
 };
 
 module_platform_driver(pmic_gpio_driver);
-- 
2.40.1


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

* [PATCH 16/20] pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (16 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:43   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, linux-arm-msm,
	linux-gpio, 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 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/pinctrl/qcom/pinctrl-spmi-mpp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index fe0393829c20..d16ece90d926 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -971,12 +971,11 @@ static int pmic_mpp_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pmic_mpp_remove(struct platform_device *pdev)
+static void pmic_mpp_remove(struct platform_device *pdev)
 {
 	struct pmic_mpp_state *state = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&state->chip);
-	return 0;
 }
 
 static const struct of_device_id pmic_mpp_of_match[] = {
@@ -1001,7 +1000,7 @@ static struct platform_driver pmic_mpp_driver = {
 		   .of_match_table = pmic_mpp_of_match,
 	},
 	.probe	= pmic_mpp_probe,
-	.remove = pmic_mpp_remove,
+	.remove_new = pmic_mpp_remove,
 };
 
 module_platform_driver(pmic_mpp_driver);
-- 
2.40.1


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

* [PATCH 17/20] pinctrl: qcom: ssbi-gpio: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (17 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:43   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-gpio, 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 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/pinctrl/qcom/pinctrl-ssbi-gpio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index e0d43d076c01..9cd5247ea574 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -853,13 +853,11 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pm8xxx_gpio_remove(struct platform_device *pdev)
+static void pm8xxx_gpio_remove(struct platform_device *pdev)
 {
 	struct pm8xxx_gpio *pctrl = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&pctrl->chip);
-
-	return 0;
 }
 
 static struct platform_driver pm8xxx_gpio_driver = {
@@ -868,7 +866,7 @@ static struct platform_driver pm8xxx_gpio_driver = {
 		.of_match_table = pm8xxx_gpio_of_match,
 	},
 	.probe = pm8xxx_gpio_probe,
-	.remove = pm8xxx_gpio_remove,
+	.remove_new = pm8xxx_gpio_remove,
 };
 
 module_platform_driver(pm8xxx_gpio_driver);
-- 
2.40.1


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

* [PATCH 18/20] pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (18 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:44   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-gpio, 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 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/pinctrl/qcom/pinctrl-ssbi-mpp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
index 985d1a0ee8f8..3aee6835a2de 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
@@ -936,13 +936,11 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pm8xxx_mpp_remove(struct platform_device *pdev)
+static void pm8xxx_mpp_remove(struct platform_device *pdev)
 {
 	struct pm8xxx_mpp *pctrl = platform_get_drvdata(pdev);
 
 	gpiochip_remove(&pctrl->chip);
-
-	return 0;
 }
 
 static struct platform_driver pm8xxx_mpp_driver = {
@@ -951,7 +949,7 @@ static struct platform_driver pm8xxx_mpp_driver = {
 		.of_match_table = pm8xxx_mpp_of_match,
 	},
 	.probe = pm8xxx_mpp_probe,
-	.remove = pm8xxx_mpp_remove,
+	.remove_new = pm8xxx_mpp_remove,
 };
 
 module_platform_driver(pm8xxx_mpp_driver);
-- 
2.40.1


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

* [PATCH 19/20] pinctrl: renesas: rzn1: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (19 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-09  9:39   ` Geert Uytterhoeven
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Geert Uytterhoeven, linux-renesas-soc, linux-gpio, 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 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/pinctrl/renesas/pinctrl-rzn1.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
index 374b9f281324..4b2f107824fe 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
@@ -920,13 +920,11 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rzn1_pinctrl_remove(struct platform_device *pdev)
+static void rzn1_pinctrl_remove(struct platform_device *pdev)
 {
 	struct rzn1_pinctrl *ipctl = platform_get_drvdata(pdev);
 
 	clk_disable_unprepare(ipctl->clk);
-
-	return 0;
 }
 
 static const struct of_device_id rzn1_pinctrl_match[] = {
@@ -937,7 +935,7 @@ MODULE_DEVICE_TABLE(of, rzn1_pinctrl_match);
 
 static struct platform_driver rzn1_pinctrl_driver = {
 	.probe	= rzn1_pinctrl_probe,
-	.remove = rzn1_pinctrl_remove,
+	.remove_new = rzn1_pinctrl_remove,
 	.driver	= {
 		.name		= "rzn1-pinctrl",
 		.of_match_table	= rzn1_pinctrl_match,
-- 
2.40.1


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

* [PATCH 20/20] pinctrl: ti: ti-iodelay: Convert to platform remove callback returning void
  2023-10-09  8:38 ` Uwe Kleine-König
                   ` (20 preceding siblings ...)
  (?)
@ 2023-10-09  8:38 ` Uwe Kleine-König
  2023-10-10 13:45   ` Linus Walleij
  -1 siblings, 1 reply; 67+ messages in thread
From: Uwe Kleine-König @ 2023-10-09  8:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Yangtao Li, Andy Shevchenko, linux-gpio, 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 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/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index f3a273562095..0ac2548ca68d 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -896,10 +896,8 @@ static int ti_iodelay_probe(struct platform_device *pdev)
 /**
  * ti_iodelay_remove() - standard remove
  * @pdev: platform device
- *
- * Return: 0 if all went fine, else appropriate error value.
  */
-static int ti_iodelay_remove(struct platform_device *pdev)
+static void ti_iodelay_remove(struct platform_device *pdev)
 {
 	struct ti_iodelay_device *iod = platform_get_drvdata(pdev);
 
@@ -909,13 +907,11 @@ static int ti_iodelay_remove(struct platform_device *pdev)
 	ti_iodelay_pinconf_deinit_dev(iod);
 
 	/* Expect other allocations to be freed by devm */
-
-	return 0;
 }
 
 static struct platform_driver ti_iodelay_driver = {
 	.probe = ti_iodelay_probe,
-	.remove = ti_iodelay_remove,
+	.remove_new = ti_iodelay_remove,
 	.driver = {
 		   .name = DRIVER_NAME,
 		   .of_match_table = ti_iodelay_of_match,
-- 
2.40.1


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

* Re: [PATCH 19/20] pinctrl: renesas: rzn1: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 19/20] pinctrl: renesas: rzn1: " Uwe Kleine-König
@ 2023-10-09  9:39   ` Geert Uytterhoeven
  2023-10-10 13:45     ` Linus Walleij
  0 siblings, 1 reply; 67+ messages in thread
From: Geert Uytterhoeven @ 2023-10-09  9:39 UTC (permalink / raw)
  To: Uwe Kleine-König, Linus Walleij
  Cc: linux-renesas-soc, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Linus: do you plan to take this whole series directly?
If yes:
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Otherwise, I can queue it in renesas-pinctrl-for-v6.7 for my
second PR for v6.7 this Friday.

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-10-09 10:37   ` Charles Keepax
  2023-10-10 13:37   ` Linus Walleij
  1 sibling, 0 replies; 67+ messages in thread
From: Charles Keepax @ 2023-10-09 10:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, Richard Fitzgerald, alsa-devel, patches,
	linux-gpio, linux-kernel

On Mon, Oct 09, 2023 at 10:38:40AM +0200, Uwe Kleine-König 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: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 05/20] pinctrl: intel: cherryview: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 05/20] pinctrl: intel: cherryview: " Uwe Kleine-König
@ 2023-10-09 11:10   ` Mika Westerberg
  2023-10-10 13:18     ` Andy Shevchenko
  0 siblings, 1 reply; 67+ messages in thread
From: Mika Westerberg @ 2023-10-09 11:10 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel

On Mon, Oct 09, 2023 at 10:38:41AM +0200, Uwe Kleine-König 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: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH 06/20] pinctrl: intel: lynxpoint: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 06/20] pinctrl: intel: lynxpoint: " Uwe Kleine-König
@ 2023-10-09 11:10   ` Mika Westerberg
  2023-10-10 13:18     ` Andy Shevchenko
  2023-10-10 15:34     ` Andy Shevchenko
  0 siblings, 2 replies; 67+ messages in thread
From: Mika Westerberg @ 2023-10-09 11:10 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, linux-kernel

On Mon, Oct 09, 2023 at 10:38:42AM +0200, Uwe Kleine-König 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: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
  2023-10-09  8:38   ` Uwe Kleine-König
  (?)
@ 2023-10-09 20:16     ` Heiko Stuebner
  -1 siblings, 0 replies; 67+ messages in thread
From: Heiko Stuebner @ 2023-10-09 20:16 UTC (permalink / raw)
  To: Linus Walleij, Uwe Kleine-König
  Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel

Am Montag, 9. Oktober 2023, 10:38:47 CEST schrieb Uwe Kleine-König:
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/pinctrl/pinctrl-rockchip.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index 45e416f68e74..3bedf36a0019 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int rockchip_pinctrl_remove(struct platform_device *pdev)
> +static void rockchip_pinctrl_remove(struct platform_device *pdev)
>  {
>  	struct rockchip_pinctrl *info = platform_get_drvdata(pdev);
>  	struct rockchip_pin_bank *bank;
> @@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev)
>  		}
>  		mutex_unlock(&bank->deferred_lock);
>  	}
> -
> -	return 0;
>  }
>  
>  static struct rockchip_pin_bank px30_pin_banks[] = {
> @@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
>  
>  static struct platform_driver rockchip_pinctrl_driver = {
>  	.probe		= rockchip_pinctrl_probe,
> -	.remove		= rockchip_pinctrl_remove,
> +	.remove_new	= rockchip_pinctrl_remove,
>  	.driver = {
>  		.name	= "rockchip-pinctrl",
>  		.pm = &rockchip_pinctrl_dev_pm_ops,
> 





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

* Re: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
@ 2023-10-09 20:16     ` Heiko Stuebner
  0 siblings, 0 replies; 67+ messages in thread
From: Heiko Stuebner @ 2023-10-09 20:16 UTC (permalink / raw)
  To: Linus Walleij, Uwe Kleine-König
  Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel

Am Montag, 9. Oktober 2023, 10:38:47 CEST schrieb Uwe Kleine-König:
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/pinctrl/pinctrl-rockchip.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index 45e416f68e74..3bedf36a0019 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int rockchip_pinctrl_remove(struct platform_device *pdev)
> +static void rockchip_pinctrl_remove(struct platform_device *pdev)
>  {
>  	struct rockchip_pinctrl *info = platform_get_drvdata(pdev);
>  	struct rockchip_pin_bank *bank;
> @@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev)
>  		}
>  		mutex_unlock(&bank->deferred_lock);
>  	}
> -
> -	return 0;
>  }
>  
>  static struct rockchip_pin_bank px30_pin_banks[] = {
> @@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
>  
>  static struct platform_driver rockchip_pinctrl_driver = {
>  	.probe		= rockchip_pinctrl_probe,
> -	.remove		= rockchip_pinctrl_remove,
> +	.remove_new	= rockchip_pinctrl_remove,
>  	.driver = {
>  		.name	= "rockchip-pinctrl",
>  		.pm = &rockchip_pinctrl_dev_pm_ops,
> 





_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
@ 2023-10-09 20:16     ` Heiko Stuebner
  0 siblings, 0 replies; 67+ messages in thread
From: Heiko Stuebner @ 2023-10-09 20:16 UTC (permalink / raw)
  To: Linus Walleij, Uwe Kleine-König
  Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel

Am Montag, 9. Oktober 2023, 10:38:47 CEST schrieb Uwe Kleine-König:
> 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>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> ---
>  drivers/pinctrl/pinctrl-rockchip.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index 45e416f68e74..3bedf36a0019 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int rockchip_pinctrl_remove(struct platform_device *pdev)
> +static void rockchip_pinctrl_remove(struct platform_device *pdev)
>  {
>  	struct rockchip_pinctrl *info = platform_get_drvdata(pdev);
>  	struct rockchip_pin_bank *bank;
> @@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev)
>  		}
>  		mutex_unlock(&bank->deferred_lock);
>  	}
> -
> -	return 0;
>  }
>  
>  static struct rockchip_pin_bank px30_pin_banks[] = {
> @@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = {
>  
>  static struct platform_driver rockchip_pinctrl_driver = {
>  	.probe		= rockchip_pinctrl_probe,
> -	.remove		= rockchip_pinctrl_remove,
> +	.remove_new	= rockchip_pinctrl_remove,
>  	.driver = {
>  		.name	= "rockchip-pinctrl",
>  		.pm = &rockchip_pinctrl_dev_pm_ops,
> 





_______________________________________________
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] 67+ messages in thread

* Re: [PATCH 09/20] pinctrl: artpec6: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 09/20] pinctrl: artpec6: " Uwe Kleine-König
@ 2023-10-10  8:40   ` Jesper Nilsson
  2023-10-10 13:39   ` Linus Walleij
  1 sibling, 0 replies; 67+ messages in thread
From: Jesper Nilsson @ 2023-10-10  8:40 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Linus Walleij, Jesper Nilsson, Lars Persson, linux-arm-kernel,
	linux-gpio, linux-kernel

On Mon, Oct 09, 2023 at 10:38:45AM +0200, Uwe Kleine-König 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: Jesper Nilsson <jesper.nilsson@axis.com>


/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

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

* Re: [PATCH 05/20] pinctrl: intel: cherryview: Convert to platform remove callback returning void
  2023-10-09 11:10   ` Mika Westerberg
@ 2023-10-10 13:18     ` Andy Shevchenko
  0 siblings, 0 replies; 67+ messages in thread
From: Andy Shevchenko @ 2023-10-10 13:18 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Uwe Kleine-König, Linus Walleij, linux-gpio, linux-kernel

On Mon, Oct 09, 2023 at 02:10:12PM +0300, Mika Westerberg wrote:
> On Mon, Oct 09, 2023 at 10:38:41AM +0200, Uwe Kleine-König 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: Mika Westerberg <mika.westerberg@linux.intel.com>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 06/20] pinctrl: intel: lynxpoint: Convert to platform remove callback returning void
  2023-10-09 11:10   ` Mika Westerberg
@ 2023-10-10 13:18     ` Andy Shevchenko
  2023-10-10 15:34     ` Andy Shevchenko
  1 sibling, 0 replies; 67+ messages in thread
From: Andy Shevchenko @ 2023-10-10 13:18 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Uwe Kleine-König, Linus Walleij, linux-gpio, linux-kernel

On Mon, Oct 09, 2023 at 02:10:48PM +0300, Mika Westerberg wrote:
> On Mon, Oct 09, 2023 at 10:38:42AM +0200, Uwe Kleine-König 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: Mika Westerberg <mika.westerberg@linux.intel.com>

Pushed to my review and testing queue, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path
  2023-10-09  8:38   ` Uwe Kleine-König
@ 2023-10-10 13:35     ` Linus Walleij
  -1 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:


> The driver core has no handling for errors returned by the .remove()
> callback. The only action on error is a dev_warn() with generic error
> message that the returned value is returned.
>
> Replace it by a more specific and useful message. Then returning zero is
> the right thing to do, the only effect is to suppress the core's
> warning.
>
> This prepares the driver for the conversion to .remove_new().
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path
@ 2023-10-10 13:35     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:


> The driver core has no handling for errors returned by the .remove()
> callback. The only action on error is a dev_warn() with generic error
> message that the returned value is returned.
>
> Replace it by a more specific and useful message. Then returning zero is
> the right thing to do, the only effect is to suppress the core's
> warning.
>
> This prepares the driver for the conversion to .remove_new().
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied.

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] 67+ messages in thread

* Re: [PATCH 02/20] pinctrl: single: Drop if block with always false condition
  2023-10-09  8:38   ` Uwe Kleine-König
@ 2023-10-10 13:36     ` Linus Walleij
  -1 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:36 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:


> pcs_remove() is only called after pcs_probe() completed successfully. In
> this case platform_set_drvdata() was called with a non-NULL argument and
> so platform_get_drvdata() won't return NULL.
>
> Simplify by removing the if block with the always false condition.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 02/20] pinctrl: single: Drop if block with always false condition
@ 2023-10-10 13:36     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:36 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:


> pcs_remove() is only called after pcs_probe() completed successfully. In
> this case platform_set_drvdata() was called with a non-NULL argument and
> so platform_get_drvdata() won't return NULL.
>
> Simplify by removing the if block with the always false condition.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied.

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] 67+ messages in thread

* Re: [PATCH 03/20] pinctrl: ti: ti-iodelay: Drop if block with always false condition
  2023-10-09  8:38 ` [PATCH 03/20] pinctrl: ti: ti-iodelay: " Uwe Kleine-König
@ 2023-10-10 13:36   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:36 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Yangtao Li, Andy Shevchenko, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:


> ti_iodelay_remove() is only called after ti_iodelay_probe() completed
> successfully. In this case platform_set_drvdata() was called with a
> non-NULL argument and so platform_get_drvdata() won't return NULL.
>
> Simplify by removing the if block with the always false condition.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void Uwe Kleine-König
  2023-10-09 10:37   ` Charles Keepax
@ 2023-10-10 13:37   ` Linus Walleij
  1 sibling, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Charles Keepax, Richard Fitzgerald, alsa-devel, patches,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 07/20] pinctrl: nomadik: abx500: Convert to platform remove callback returning void
  2023-10-09  8:38   ` Uwe Kleine-König
@ 2023-10-10 13:38     ` Linus Walleij
  -1 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:38 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-arm-kernel, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 07/20] pinctrl: nomadik: abx500: Convert to platform remove callback returning void
@ 2023-10-10 13:38     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:38 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-arm-kernel, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

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] 67+ messages in thread

* Re: [PATCH 08/20] pinctrl: amd: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 08/20] pinctrl: amd: " Uwe Kleine-König
@ 2023-10-10 13:38   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:38 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Basavaraj Natikar, Shyam Sundar S K, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 09/20] pinctrl: artpec6: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 09/20] pinctrl: artpec6: " Uwe Kleine-König
  2023-10-10  8:40   ` Jesper Nilsson
@ 2023-10-10 13:39   ` Linus Walleij
  1 sibling, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:39 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Jesper Nilsson, Lars Persson, linux-arm-kernel, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 10/20] pinctrl: as3722: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 10/20] pinctrl: as3722: " Uwe Kleine-König
@ 2023-10-10 13:39   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:39 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
  2023-10-09  8:38   ` Uwe Kleine-König
  (?)
@ 2023-10-10 13:40     ` Linus Walleij
  -1 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:40 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
	linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
@ 2023-10-10 13:40     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:40 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
	linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

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] 67+ messages in thread

* Re: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void
@ 2023-10-10 13:40     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:40 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
	linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 12/20] pinctrl: single: Convert to platform remove callback returning void
  2023-10-09  8:38   ` Uwe Kleine-König
@ 2023-10-10 13:41     ` Linus Walleij
  -1 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:41 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:23 AM 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>

Patch applied.

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] 67+ messages in thread

* Re: [PATCH 12/20] pinctrl: single: Convert to platform remove callback returning void
@ 2023-10-10 13:41     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:41 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Tony Lindgren, Haojian Zhuang, linux-arm-kernel, linux-omap,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:23 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 13/20] pinctrl: stmfx: Convert to platform remove callback returning void
  2023-10-09  8:38   ` Uwe Kleine-König
@ 2023-10-10 13:41     ` Linus Walleij
  -1 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:41 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

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] 67+ messages in thread

* Re: [PATCH 13/20] pinctrl: stmfx: Convert to platform remove callback returning void
@ 2023-10-10 13:41     ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:41 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-stm32,
	linux-arm-kernel, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 14/20] pinctrl: tb10x: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 14/20] pinctrl: tb10x: " Uwe Kleine-König
@ 2023-10-10 13:42   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:42 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 15/20] pinctrl: qcom: spmi-gpio: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 15/20] pinctrl: qcom: spmi-gpio: " Uwe Kleine-König
@ 2023-10-10 13:42   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:42 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 16/20] pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 16/20] pinctrl: qcom: spmi-mpp: " Uwe Kleine-König
@ 2023-10-10 13:43   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:43 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Bjorn Andersson, Andy Gross, Konrad Dybcio, linux-arm-msm,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 17/20] pinctrl: qcom: ssbi-gpio: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 17/20] pinctrl: qcom: ssbi-gpio: " Uwe Kleine-König
@ 2023-10-10 13:43   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:43 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 18/20] pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 18/20] pinctrl: qcom: ssbi-mpp: " Uwe Kleine-König
@ 2023-10-10 13:44   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:44 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 19/20] pinctrl: renesas: rzn1: Convert to platform remove callback returning void
  2023-10-09  9:39   ` Geert Uytterhoeven
@ 2023-10-10 13:45     ` Linus Walleij
  2023-10-10 13:48       ` Geert Uytterhoeven
  0 siblings, 1 reply; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Uwe Kleine-König, linux-renesas-soc, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:39 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:

> Linus: do you plan to take this whole series directly?
> If yes:
> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Otherwise, I can queue it in renesas-pinctrl-for-v6.7 for my
> second PR for v6.7 this Friday.

You pick it! Andy is already picking the Intel changes, so it
is better to refer to submaintainers where we have them!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 20/20] pinctrl: ti: ti-iodelay: Convert to platform remove callback returning void
  2023-10-09  8:38 ` [PATCH 20/20] pinctrl: ti: ti-iodelay: " Uwe Kleine-König
@ 2023-10-10 13:45   ` Linus Walleij
  0 siblings, 0 replies; 67+ messages in thread
From: Linus Walleij @ 2023-10-10 13:45 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Yangtao Li, Andy Shevchenko, linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 11:22 AM 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>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH 19/20] pinctrl: renesas: rzn1: Convert to platform remove callback returning void
  2023-10-10 13:45     ` Linus Walleij
@ 2023-10-10 13:48       ` Geert Uytterhoeven
  0 siblings, 0 replies; 67+ messages in thread
From: Geert Uytterhoeven @ 2023-10-10 13:48 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Uwe Kleine-König, linux-renesas-soc, linux-gpio, linux-kernel

Hi Linus,

On Tue, Oct 10, 2023 at 3:45 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Mon, Oct 9, 2023 at 11:39 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > Linus: do you plan to take this whole series directly?
> > If yes:
> > Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > Otherwise, I can queue it in renesas-pinctrl-for-v6.7 for my
> > second PR for v6.7 this Friday.
>
> You pick it! Andy is already picking the Intel changes, so it
> is better to refer to submaintainers where we have them!

OK.

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

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 06/20] pinctrl: intel: lynxpoint: Convert to platform remove callback returning void
  2023-10-09 11:10   ` Mika Westerberg
  2023-10-10 13:18     ` Andy Shevchenko
@ 2023-10-10 15:34     ` Andy Shevchenko
  1 sibling, 0 replies; 67+ messages in thread
From: Andy Shevchenko @ 2023-10-10 15:34 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Uwe Kleine-König, Linus Walleij, Andy Shevchenko,
	linux-gpio, linux-kernel

On Mon, Oct 9, 2023 at 2:10 PM Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> On Mon, Oct 09, 2023 at 10:38:42AM +0200, Uwe Kleine-König wrote:

...

> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Actually this one got skipped as there is no more ->remove() in the driver!

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2023-10-10 15:35 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-09  8:38 [PATCH 00/20] pinctrl: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-09  8:38 ` Uwe Kleine-König
2023-10-09  8:38 ` Uwe Kleine-König
2023-10-09  8:38 ` [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-10 13:35   ` Linus Walleij
2023-10-10 13:35     ` Linus Walleij
2023-10-09  8:38 ` [PATCH 02/20] pinctrl: single: Drop if block with always false condition Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-10 13:36   ` Linus Walleij
2023-10-10 13:36     ` Linus Walleij
2023-10-09  8:38 ` [PATCH 03/20] pinctrl: ti: ti-iodelay: " Uwe Kleine-König
2023-10-10 13:36   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void Uwe Kleine-König
2023-10-09 10:37   ` Charles Keepax
2023-10-10 13:37   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 05/20] pinctrl: intel: cherryview: " Uwe Kleine-König
2023-10-09 11:10   ` Mika Westerberg
2023-10-10 13:18     ` Andy Shevchenko
2023-10-09  8:38 ` [PATCH 06/20] pinctrl: intel: lynxpoint: " Uwe Kleine-König
2023-10-09 11:10   ` Mika Westerberg
2023-10-10 13:18     ` Andy Shevchenko
2023-10-10 15:34     ` Andy Shevchenko
2023-10-09  8:38 ` [PATCH 07/20] pinctrl: nomadik: abx500: " Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-10 13:38   ` Linus Walleij
2023-10-10 13:38     ` Linus Walleij
2023-10-09  8:38 ` [PATCH 08/20] pinctrl: amd: " Uwe Kleine-König
2023-10-10 13:38   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 09/20] pinctrl: artpec6: " Uwe Kleine-König
2023-10-10  8:40   ` Jesper Nilsson
2023-10-10 13:39   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 10/20] pinctrl: as3722: " Uwe Kleine-König
2023-10-10 13:39   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 11/20] pinctrl: rockchip: " Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-09 20:16   ` Heiko Stuebner
2023-10-09 20:16     ` Heiko Stuebner
2023-10-09 20:16     ` Heiko Stuebner
2023-10-10 13:40   ` Linus Walleij
2023-10-10 13:40     ` Linus Walleij
2023-10-10 13:40     ` Linus Walleij
2023-10-09  8:38 ` [PATCH 12/20] pinctrl: single: " Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-10 13:41   ` Linus Walleij
2023-10-10 13:41     ` Linus Walleij
2023-10-09  8:38 ` [PATCH 13/20] pinctrl: stmfx: " Uwe Kleine-König
2023-10-09  8:38   ` Uwe Kleine-König
2023-10-10 13:41   ` Linus Walleij
2023-10-10 13:41     ` Linus Walleij
2023-10-09  8:38 ` [PATCH 14/20] pinctrl: tb10x: " Uwe Kleine-König
2023-10-10 13:42   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 15/20] pinctrl: qcom: spmi-gpio: " Uwe Kleine-König
2023-10-10 13:42   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 16/20] pinctrl: qcom: spmi-mpp: " Uwe Kleine-König
2023-10-10 13:43   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 17/20] pinctrl: qcom: ssbi-gpio: " Uwe Kleine-König
2023-10-10 13:43   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 18/20] pinctrl: qcom: ssbi-mpp: " Uwe Kleine-König
2023-10-10 13:44   ` Linus Walleij
2023-10-09  8:38 ` [PATCH 19/20] pinctrl: renesas: rzn1: " Uwe Kleine-König
2023-10-09  9:39   ` Geert Uytterhoeven
2023-10-10 13:45     ` Linus Walleij
2023-10-10 13:48       ` Geert Uytterhoeven
2023-10-09  8:38 ` [PATCH 20/20] pinctrl: ti: ti-iodelay: " Uwe Kleine-König
2023-10-10 13:45   ` Linus Walleij

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.