* [PATCH 00/23] gpio: Convert to platform remove callback returning void
@ 2023-09-28 7:06 Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 03/23] gpio: brcmstb: " Uwe Kleine-König
` (8 more replies)
0 siblings, 9 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:06 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Mun Yew Tham, Andy Shevchenko, linux-gpio, linux-kernel,
Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, linux-arm-kernel,
Vladimir Zapolskiy, Grygorii Strashko, Santosh Shilimkar,
Kevin Hilman, linux-omap, Heiko Stuebner, linux-rockchip,
Kunihiko Hayashi, Masami Hiramatsu, Ray Jui, Scott Branden,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Hello,
this series converts all platform drivers below drivers/gpio to use
.remove_new(). The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side.
See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.
There are no interdependencies between the patches. 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 subject prefix is suboptimal, please apply the remainder of
this series anyhow.
Best regards
Uwe
Uwe Kleine-König (23):
gpio: altera: Convert to platform remove callback returning void
gpio: amdpt: Convert to platform remove callback returning void
gpio: brcmstb: Convert to platform remove callback returning void
gpio: cadence: Convert to platform remove callback returning void
gpio: dln2: Convert to platform remove callback returning void
gpio: ftgpio010: Convert to platform remove callback returning void
gpio: grgpio: Convert to platform remove callback returning void
gpio: ljca: Convert to platform remove callback returning void
gpio: lpc18xx: Convert to platform remove callback returning void
gpio: mb86s7x: Convert to platform remove callback returning void
gpio: mm-lantiq: Convert to platform remove callback returning void
gpio: mpc5200: Convert to platform remove callback returning void
gpio: mpc8xxx: Convert to platform remove callback returning void
gpio: omap: Convert to platform remove callback returning void
gpio: rcar: Convert to platform remove callback returning void
gpio: rockchip: Convert to platform remove callback returning void
gpio: tb10x: Convert to platform remove callback returning void
gpio: ts5500: Convert to platform remove callback returning void
gpio: uniphier: Convert to platform remove callback returning void
gpio: xgene-sb: Convert to platform remove callback returning void
gpio: xgs-iproc: Convert to platform remove callback returning void
gpio: xilinx: Convert to platform remove callback returning void
gpio: zynq: Convert to platform remove callback returning void
drivers/gpio/gpio-altera.c | 6 ++----
drivers/gpio/gpio-amdpt.c | 6 ++----
drivers/gpio/gpio-brcmstb.c | 6 ++----
drivers/gpio/gpio-cadence.c | 6 ++----
drivers/gpio/gpio-dln2.c | 6 ++----
drivers/gpio/gpio-ftgpio010.c | 6 ++----
drivers/gpio/gpio-grgpio.c | 6 ++----
drivers/gpio/gpio-ljca.c | 5 ++---
drivers/gpio/gpio-lpc18xx.c | 6 ++----
drivers/gpio/gpio-mb86s7x.c | 6 ++----
drivers/gpio/gpio-mm-lantiq.c | 6 ++----
drivers/gpio/gpio-mpc5200.c | 8 +++-----
drivers/gpio/gpio-mpc8xxx.c | 6 ++----
drivers/gpio/gpio-omap.c | 6 ++----
drivers/gpio/gpio-rcar.c | 5 ++---
drivers/gpio/gpio-rockchip.c | 6 ++----
drivers/gpio/gpio-tb10x.c | 6 ++----
drivers/gpio/gpio-ts5500.c | 6 ++----
drivers/gpio/gpio-uniphier.c | 6 ++----
drivers/gpio/gpio-xgene-sb.c | 6 ++----
drivers/gpio/gpio-xgs-iproc.c | 6 ++----
drivers/gpio/gpio-xilinx.c | 6 ++----
drivers/gpio/gpio-zynq.c | 5 ++---
23 files changed, 47 insertions(+), 90 deletions(-)
base-commit: 719136e5c24768ebdf80b9daa53facebbdd377c3
--
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] 14+ messages in thread
* [PATCH 03/23] gpio: brcmstb: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-28 7:06 ` Uwe Kleine-König
2023-09-28 21:22 ` Florian Fainelli
2023-09-28 7:06 ` [PATCH 09/23] gpio: lpc18xx: " Uwe Kleine-König
` (7 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:06 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, Andy Shevchenko, linux-gpio,
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/gpio/gpio-brcmstb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index bccdbfd5ec80..a789af4a5c85 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -371,7 +371,7 @@ static int brcmstb_gpio_sanity_check_banks(struct device *dev,
}
}
-static int brcmstb_gpio_remove(struct platform_device *pdev)
+static void brcmstb_gpio_remove(struct platform_device *pdev)
{
struct brcmstb_gpio_priv *priv = platform_get_drvdata(pdev);
struct brcmstb_gpio_bank *bank;
@@ -395,8 +395,6 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
*/
list_for_each_entry(bank, &priv->bank_list, node)
gpiochip_remove(&bank->gc);
-
- return 0;
}
static int brcmstb_gpio_of_xlate(struct gpio_chip *gc,
@@ -757,7 +755,7 @@ static struct platform_driver brcmstb_gpio_driver = {
.pm = &brcmstb_gpio_pm_ops,
},
.probe = brcmstb_gpio_probe,
- .remove = brcmstb_gpio_remove,
+ .remove_new = brcmstb_gpio_remove,
.shutdown = brcmstb_gpio_shutdown,
};
module_platform_driver(brcmstb_gpio_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] 14+ messages in thread
* [PATCH 09/23] gpio: lpc18xx: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 03/23] gpio: brcmstb: " Uwe Kleine-König
@ 2023-09-28 7:06 ` Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 16/23] gpio: rockchip: " Uwe Kleine-König
` (6 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:06 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Andy Shevchenko, Vladimir Zapolskiy, linux-gpio, 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/gpio/gpio-lpc18xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-lpc18xx.c b/drivers/gpio/gpio-lpc18xx.c
index ed3f653a1dfc..5c6bb57a8c99 100644
--- a/drivers/gpio/gpio-lpc18xx.c
+++ b/drivers/gpio/gpio-lpc18xx.c
@@ -381,7 +381,7 @@ static int lpc18xx_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int lpc18xx_gpio_remove(struct platform_device *pdev)
+static void lpc18xx_gpio_remove(struct platform_device *pdev)
{
struct lpc18xx_gpio_chip *gc = platform_get_drvdata(pdev);
@@ -389,8 +389,6 @@ static int lpc18xx_gpio_remove(struct platform_device *pdev)
irq_domain_remove(gc->pin_ic->domain);
clk_disable_unprepare(gc->clk);
-
- return 0;
}
static const struct of_device_id lpc18xx_gpio_match[] = {
@@ -401,7 +399,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_gpio_match);
static struct platform_driver lpc18xx_gpio_driver = {
.probe = lpc18xx_gpio_probe,
- .remove = lpc18xx_gpio_remove,
+ .remove_new = lpc18xx_gpio_remove,
.driver = {
.name = "lpc18xx-gpio",
.of_match_table = lpc18xx_gpio_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] 14+ messages in thread
* [PATCH 16/23] gpio: rockchip: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 03/23] gpio: brcmstb: " Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 09/23] gpio: lpc18xx: " Uwe Kleine-König
@ 2023-09-28 7:06 ` Uwe Kleine-König
2023-10-01 22:45 ` Heiko Stuebner
2023-09-28 7:07 ` [PATCH 19/23] gpio: uniphier: " Uwe Kleine-König
` (5 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:06 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Andy Shevchenko, 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/gpio/gpio-rockchip.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index b35b9604413f..23040a8cea34 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -778,14 +778,12 @@ static int rockchip_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int rockchip_gpio_remove(struct platform_device *pdev)
+static void rockchip_gpio_remove(struct platform_device *pdev)
{
struct rockchip_pin_bank *bank = platform_get_drvdata(pdev);
clk_disable_unprepare(bank->clk);
gpiochip_remove(&bank->gpio_chip);
-
- return 0;
}
static const struct of_device_id rockchip_gpio_match[] = {
@@ -796,7 +794,7 @@ static const struct of_device_id rockchip_gpio_match[] = {
static struct platform_driver rockchip_gpio_driver = {
.probe = rockchip_gpio_probe,
- .remove = rockchip_gpio_remove,
+ .remove_new = rockchip_gpio_remove,
.driver = {
.name = "rockchip-gpio",
.of_match_table = rockchip_gpio_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] 14+ messages in thread
* [PATCH 19/23] gpio: uniphier: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-09-28 7:06 ` [PATCH 16/23] gpio: rockchip: " Uwe Kleine-König
@ 2023-09-28 7:07 ` Uwe Kleine-König
2023-09-28 7:07 ` [PATCH 21/23] gpio: xgs-iproc: " Uwe Kleine-König
` (4 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:07 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Andy Shevchenko, Kunihiko Hayashi, Masami Hiramatsu, linux-gpio,
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/gpio/gpio-uniphier.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index 9725b7aa18a7..1f440707f8f4 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -414,13 +414,11 @@ static int uniphier_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int uniphier_gpio_remove(struct platform_device *pdev)
+static void uniphier_gpio_remove(struct platform_device *pdev)
{
struct uniphier_gpio_priv *priv = platform_get_drvdata(pdev);
irq_domain_remove(priv->domain);
-
- return 0;
}
static int __maybe_unused uniphier_gpio_suspend(struct device *dev)
@@ -482,7 +480,7 @@ MODULE_DEVICE_TABLE(of, uniphier_gpio_match);
static struct platform_driver uniphier_gpio_driver = {
.probe = uniphier_gpio_probe,
- .remove = uniphier_gpio_remove,
+ .remove_new = uniphier_gpio_remove,
.driver = {
.name = "uniphier-gpio",
.of_match_table = uniphier_gpio_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] 14+ messages in thread
* [PATCH 21/23] gpio: xgs-iproc: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
` (3 preceding siblings ...)
2023-09-28 7:07 ` [PATCH 19/23] gpio: uniphier: " Uwe Kleine-König
@ 2023-09-28 7:07 ` Uwe Kleine-König
2023-09-28 21:22 ` Florian Fainelli
2023-09-28 7:07 ` [PATCH 22/23] gpio: xilinx: " Uwe Kleine-König
` (3 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:07 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Andy Shevchenko, Ray Jui, Scott Branden,
Broadcom internal kernel review list, linux-gpio,
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/gpio/gpio-xgs-iproc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c
index 2d23b27d55af..d445eea03687 100644
--- a/drivers/gpio/gpio-xgs-iproc.c
+++ b/drivers/gpio/gpio-xgs-iproc.c
@@ -291,7 +291,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int iproc_gpio_remove(struct platform_device *pdev)
+static void iproc_gpio_remove(struct platform_device *pdev)
{
struct iproc_gpio_chip *chip = platform_get_drvdata(pdev);
@@ -302,8 +302,6 @@ static int iproc_gpio_remove(struct platform_device *pdev)
val &= ~IPROC_CCA_INT_F_GPIOINT;
writel_relaxed(val, chip->intr + IPROC_CCA_INT_MASK);
}
-
- return 0;
}
static const struct of_device_id bcm_iproc_gpio_of_match[] = {
@@ -318,7 +316,7 @@ static struct platform_driver bcm_iproc_gpio_driver = {
.of_match_table = bcm_iproc_gpio_of_match,
},
.probe = iproc_gpio_probe,
- .remove = iproc_gpio_remove,
+ .remove_new = iproc_gpio_remove,
};
module_platform_driver(bcm_iproc_gpio_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] 14+ messages in thread
* [PATCH 22/23] gpio: xilinx: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
` (4 preceding siblings ...)
2023-09-28 7:07 ` [PATCH 21/23] gpio: xgs-iproc: " Uwe Kleine-König
@ 2023-09-28 7:07 ` Uwe Kleine-König
2023-09-28 8:32 ` Datta, Shubhrajyoti
2023-09-28 7:07 ` [PATCH 23/23] gpio: zynq: " Uwe Kleine-König
` (2 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:07 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Andy Shevchenko,
linux-gpio, 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/gpio/gpio-xilinx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index a16945e8319e..823198368250 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -332,7 +332,7 @@ static int __maybe_unused xgpio_suspend(struct device *dev)
*
* Return: 0 always
*/
-static int xgpio_remove(struct platform_device *pdev)
+static void xgpio_remove(struct platform_device *pdev)
{
struct xgpio_instance *gpio = platform_get_drvdata(pdev);
@@ -340,8 +340,6 @@ static int xgpio_remove(struct platform_device *pdev)
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(gpio->clk);
-
- return 0;
}
/**
@@ -715,7 +713,7 @@ MODULE_DEVICE_TABLE(of, xgpio_of_match);
static struct platform_driver xgpio_plat_driver = {
.probe = xgpio_probe,
- .remove = xgpio_remove,
+ .remove_new = xgpio_remove,
.driver = {
.name = "gpio-xilinx",
.of_match_table = xgpio_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] 14+ messages in thread
* [PATCH 23/23] gpio: zynq: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
` (5 preceding siblings ...)
2023-09-28 7:07 ` [PATCH 22/23] gpio: xilinx: " Uwe Kleine-König
@ 2023-09-28 7:07 ` Uwe Kleine-König
2023-09-28 21:54 ` [PATCH 00/23] gpio: " Linus Walleij
2023-10-02 6:52 ` Bartosz Golaszewski
8 siblings, 0 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2023-09-28 7:07 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Shubhrajyoti Datta, Srinivas Neeli, Michal Simek, Andy Shevchenko,
linux-gpio, 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/gpio/gpio-zynq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 324e942c0650..466e23031afc 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -1010,7 +1010,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
*
* Return: 0 always
*/
-static int zynq_gpio_remove(struct platform_device *pdev)
+static void zynq_gpio_remove(struct platform_device *pdev)
{
struct zynq_gpio *gpio = platform_get_drvdata(pdev);
int ret;
@@ -1022,7 +1022,6 @@ static int zynq_gpio_remove(struct platform_device *pdev)
clk_disable_unprepare(gpio->clk);
device_set_wakeup_capable(&pdev->dev, 0);
pm_runtime_disable(&pdev->dev);
- return 0;
}
static struct platform_driver zynq_gpio_driver = {
@@ -1032,7 +1031,7 @@ static struct platform_driver zynq_gpio_driver = {
.of_match_table = zynq_gpio_of_match,
},
.probe = zynq_gpio_probe,
- .remove = zynq_gpio_remove,
+ .remove_new = zynq_gpio_remove,
};
module_platform_driver(zynq_gpio_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] 14+ messages in thread
* RE: [PATCH 22/23] gpio: xilinx: Convert to platform remove callback returning void
2023-09-28 7:07 ` [PATCH 22/23] gpio: xilinx: " Uwe Kleine-König
@ 2023-09-28 8:32 ` Datta, Shubhrajyoti
0 siblings, 0 replies; 14+ messages in thread
From: Datta, Shubhrajyoti @ 2023-09-28 8:32 UTC (permalink / raw)
To: Uwe Kleine-König, Linus Walleij, Bartosz Golaszewski
Cc: Neeli, Srinivas, Simek, Michal, Andy Shevchenko,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
[AMD Official Use Only - General]
Hi ,
Thanks for the patch
> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Sent: Thursday, September 28, 2023 12:37 PM
> To: Linus Walleij <linus.walleij@linaro.org>; Bartosz Golaszewski
> <brgl@bgdev.pl>
> Cc: Datta, Shubhrajyoti <shubhrajyoti.datta@amd.com>; Neeli, Srinivas
> <srinivas.neeli@amd.com>; Simek, Michal <michal.simek@amd.com>; Andy
> Shevchenko <andy@kernel.org>; linux-gpio@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 22/23] gpio: xilinx: Convert to platform remove callback
> returning void
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> 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: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
_______________________________________________
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] 14+ messages in thread
* Re: [PATCH 03/23] gpio: brcmstb: Convert to platform remove callback returning void
2023-09-28 7:06 ` [PATCH 03/23] gpio: brcmstb: " Uwe Kleine-König
@ 2023-09-28 21:22 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-09-28 21:22 UTC (permalink / raw)
To: Uwe Kleine-König, Linus Walleij, Bartosz Golaszewski
Cc: Doug Berger, Broadcom internal kernel review list,
Andy Shevchenko, linux-gpio, linux-arm-kernel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 884 bytes --]
On 9/28/2023 9:06 AM, 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>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
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] 14+ messages in thread
* Re: [PATCH 21/23] gpio: xgs-iproc: Convert to platform remove callback returning void
2023-09-28 7:07 ` [PATCH 21/23] gpio: xgs-iproc: " Uwe Kleine-König
@ 2023-09-28 21:22 ` Florian Fainelli
0 siblings, 0 replies; 14+ messages in thread
From: Florian Fainelli @ 2023-09-28 21:22 UTC (permalink / raw)
To: Uwe Kleine-König, Linus Walleij, Bartosz Golaszewski
Cc: Andy Shevchenko, Ray Jui, Scott Branden,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 884 bytes --]
On 9/28/2023 9:07 AM, 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>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
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] 14+ messages in thread
* Re: [PATCH 00/23] gpio: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
` (6 preceding siblings ...)
2023-09-28 7:07 ` [PATCH 23/23] gpio: zynq: " Uwe Kleine-König
@ 2023-09-28 21:54 ` Linus Walleij
2023-10-02 6:52 ` Bartosz Golaszewski
8 siblings, 0 replies; 14+ messages in thread
From: Linus Walleij @ 2023-09-28 21:54 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Bartosz Golaszewski, Mun Yew Tham, Andy Shevchenko, linux-gpio,
linux-kernel, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, linux-arm-kernel,
Vladimir Zapolskiy, Grygorii Strashko, Santosh Shilimkar,
Kevin Hilman, linux-omap, Heiko Stuebner, linux-rockchip,
Kunihiko Hayashi, Masami Hiramatsu, Ray Jui, Scott Branden,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
On Thu, Sep 28, 2023 at 9:07 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> this series converts all platform drivers below drivers/gpio to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
The whole set looks good to me:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 16/23] gpio: rockchip: Convert to platform remove callback returning void
2023-09-28 7:06 ` [PATCH 16/23] gpio: rockchip: " Uwe Kleine-König
@ 2023-10-01 22:45 ` Heiko Stuebner
0 siblings, 0 replies; 14+ messages in thread
From: Heiko Stuebner @ 2023-10-01 22:45 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Uwe Kleine-König
Cc: Andy Shevchenko, linux-gpio, linux-arm-kernel, linux-rockchip,
linux-kernel
Am Donnerstag, 28. September 2023, 09:06:59 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>
_______________________________________________
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] 14+ messages in thread
* Re: [PATCH 00/23] gpio: Convert to platform remove callback returning void
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
` (7 preceding siblings ...)
2023-09-28 21:54 ` [PATCH 00/23] gpio: " Linus Walleij
@ 2023-10-02 6:52 ` Bartosz Golaszewski
8 siblings, 0 replies; 14+ messages in thread
From: Bartosz Golaszewski @ 2023-10-02 6:52 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Linus Walleij, Mun Yew Tham, Andy Shevchenko, linux-gpio,
linux-kernel, Doug Berger, Florian Fainelli,
Broadcom internal kernel review list, linux-arm-kernel,
Vladimir Zapolskiy, Grygorii Strashko, Santosh Shilimkar,
Kevin Hilman, linux-omap, Heiko Stuebner, linux-rockchip,
Kunihiko Hayashi, Masami Hiramatsu, Ray Jui, Scott Branden,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
On Thu, Sep 28, 2023 at 9:07 AM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> Hello,
>
> this series converts all platform drivers below drivers/gpio to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
>
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
>
> There are no interdependencies between the patches. 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 subject prefix is suboptimal, please apply the remainder of
> this series anyhow.
>
> Best regards
> Uwe
>
> Uwe Kleine-König (23):
> gpio: altera: Convert to platform remove callback returning void
> gpio: amdpt: Convert to platform remove callback returning void
> gpio: brcmstb: Convert to platform remove callback returning void
> gpio: cadence: Convert to platform remove callback returning void
> gpio: dln2: Convert to platform remove callback returning void
> gpio: ftgpio010: Convert to platform remove callback returning void
> gpio: grgpio: Convert to platform remove callback returning void
> gpio: ljca: Convert to platform remove callback returning void
> gpio: lpc18xx: Convert to platform remove callback returning void
> gpio: mb86s7x: Convert to platform remove callback returning void
> gpio: mm-lantiq: Convert to platform remove callback returning void
> gpio: mpc5200: Convert to platform remove callback returning void
> gpio: mpc8xxx: Convert to platform remove callback returning void
> gpio: omap: Convert to platform remove callback returning void
> gpio: rcar: Convert to platform remove callback returning void
> gpio: rockchip: Convert to platform remove callback returning void
> gpio: tb10x: Convert to platform remove callback returning void
> gpio: ts5500: Convert to platform remove callback returning void
> gpio: uniphier: Convert to platform remove callback returning void
> gpio: xgene-sb: Convert to platform remove callback returning void
> gpio: xgs-iproc: Convert to platform remove callback returning void
> gpio: xilinx: Convert to platform remove callback returning void
> gpio: zynq: Convert to platform remove callback returning void
>
> drivers/gpio/gpio-altera.c | 6 ++----
> drivers/gpio/gpio-amdpt.c | 6 ++----
> drivers/gpio/gpio-brcmstb.c | 6 ++----
> drivers/gpio/gpio-cadence.c | 6 ++----
> drivers/gpio/gpio-dln2.c | 6 ++----
> drivers/gpio/gpio-ftgpio010.c | 6 ++----
> drivers/gpio/gpio-grgpio.c | 6 ++----
> drivers/gpio/gpio-ljca.c | 5 ++---
> drivers/gpio/gpio-lpc18xx.c | 6 ++----
> drivers/gpio/gpio-mb86s7x.c | 6 ++----
> drivers/gpio/gpio-mm-lantiq.c | 6 ++----
> drivers/gpio/gpio-mpc5200.c | 8 +++-----
> drivers/gpio/gpio-mpc8xxx.c | 6 ++----
> drivers/gpio/gpio-omap.c | 6 ++----
> drivers/gpio/gpio-rcar.c | 5 ++---
> drivers/gpio/gpio-rockchip.c | 6 ++----
> drivers/gpio/gpio-tb10x.c | 6 ++----
> drivers/gpio/gpio-ts5500.c | 6 ++----
> drivers/gpio/gpio-uniphier.c | 6 ++----
> drivers/gpio/gpio-xgene-sb.c | 6 ++----
> drivers/gpio/gpio-xgs-iproc.c | 6 ++----
> drivers/gpio/gpio-xilinx.c | 6 ++----
> drivers/gpio/gpio-zynq.c | 5 ++---
> 23 files changed, 47 insertions(+), 90 deletions(-)
>
>
> base-commit: 719136e5c24768ebdf80b9daa53facebbdd377c3
> --
> 2.40.1
>
Series queued for v6.7, thanks!
Bart
_______________________________________________
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] 14+ messages in thread
end of thread, other threads:[~2023-10-02 6:53 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-28 7:06 [PATCH 00/23] gpio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 03/23] gpio: brcmstb: " Uwe Kleine-König
2023-09-28 21:22 ` Florian Fainelli
2023-09-28 7:06 ` [PATCH 09/23] gpio: lpc18xx: " Uwe Kleine-König
2023-09-28 7:06 ` [PATCH 16/23] gpio: rockchip: " Uwe Kleine-König
2023-10-01 22:45 ` Heiko Stuebner
2023-09-28 7:07 ` [PATCH 19/23] gpio: uniphier: " Uwe Kleine-König
2023-09-28 7:07 ` [PATCH 21/23] gpio: xgs-iproc: " Uwe Kleine-König
2023-09-28 21:22 ` Florian Fainelli
2023-09-28 7:07 ` [PATCH 22/23] gpio: xilinx: " Uwe Kleine-König
2023-09-28 8:32 ` Datta, Shubhrajyoti
2023-09-28 7:07 ` [PATCH 23/23] gpio: zynq: " Uwe Kleine-König
2023-09-28 21:54 ` [PATCH 00/23] gpio: " Linus Walleij
2023-10-02 6:52 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox