* [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 21:52 ` Cédric Le Goater
2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
` (24 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Chin-Ting Kuo, Cédric Le Goater, Mark Brown, Joel Stanley
Cc: Andrew Jeffery, linux-aspeed, openbmc, linux-spi,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-aspeed-smc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
index 873ff2cf72c9..3f2548860317 100644
--- a/drivers/spi/spi-aspeed-smc.c
+++ b/drivers/spi/spi-aspeed-smc.c
@@ -787,13 +787,12 @@ static int aspeed_spi_probe(struct platform_device *pdev)
return ret;
}
-static int aspeed_spi_remove(struct platform_device *pdev)
+static void aspeed_spi_remove(struct platform_device *pdev)
{
struct aspeed_spi *aspi = platform_get_drvdata(pdev);
aspeed_spi_enable(aspi, false);
clk_disable_unprepare(aspi->clk);
- return 0;
}
/*
@@ -1201,7 +1200,7 @@ MODULE_DEVICE_TABLE(of, aspeed_spi_matches);
static struct platform_driver aspeed_spi_driver = {
.probe = aspeed_spi_probe,
- .remove = aspeed_spi_remove,
+ .remove_new = aspeed_spi_remove,
.driver = {
.name = DEVICE_NAME,
.of_match_table = aspeed_spi_matches,
--
2.39.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] 42+ messages in thread* Re: [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-03 21:52 ` Cédric Le Goater
0 siblings, 0 replies; 42+ messages in thread
From: Cédric Le Goater @ 2023-03-03 21:52 UTC (permalink / raw)
To: Uwe Kleine-König, Chin-Ting Kuo, Mark Brown, Joel Stanley
Cc: Andrew Jeffery, linux-aspeed, openbmc, linux-spi,
linux-arm-kernel, kernel
On 3/3/23 18:19, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> drivers/spi/spi-aspeed-smc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
> index 873ff2cf72c9..3f2548860317 100644
> --- a/drivers/spi/spi-aspeed-smc.c
> +++ b/drivers/spi/spi-aspeed-smc.c
> @@ -787,13 +787,12 @@ static int aspeed_spi_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int aspeed_spi_remove(struct platform_device *pdev)
> +static void aspeed_spi_remove(struct platform_device *pdev)
> {
> struct aspeed_spi *aspi = platform_get_drvdata(pdev);
>
> aspeed_spi_enable(aspi, false);
> clk_disable_unprepare(aspi->clk);
> - return 0;
> }
>
> /*
> @@ -1201,7 +1200,7 @@ MODULE_DEVICE_TABLE(of, aspeed_spi_matches);
>
> static struct platform_driver aspeed_spi_driver = {
> .probe = aspeed_spi_probe,
> - .remove = aspeed_spi_remove,
> + .remove_new = aspeed_spi_remove,
> .driver = {
> .name = DEVICE_NAME,
> .of_match_table = aspeed_spi_matches,
_______________________________________________
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] 42+ messages in thread
* [PATCH 04/87] spi: at91-usart: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-06 11:57 ` Claudiu.Beznea
2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
` (23 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Radu Pirea, Mark Brown, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: linux-spi, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-at91-usart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index fab9d223e24a..4fb3653b5941 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -647,15 +647,13 @@ __maybe_unused static int at91_usart_spi_resume(struct device *dev)
return spi_controller_resume(ctrl);
}
-static int at91_usart_spi_remove(struct platform_device *pdev)
+static void at91_usart_spi_remove(struct platform_device *pdev)
{
struct spi_controller *ctlr = platform_get_drvdata(pdev);
struct at91_usart_spi *aus = spi_controller_get_devdata(ctlr);
at91_usart_spi_release_dma(ctlr);
clk_disable_unprepare(aus->clk);
-
- return 0;
}
static const struct dev_pm_ops at91_usart_spi_pm_ops = {
@@ -670,7 +668,7 @@ static struct platform_driver at91_usart_spi_driver = {
.pm = &at91_usart_spi_pm_ops,
},
.probe = at91_usart_spi_probe,
- .remove = at91_usart_spi_remove,
+ .remove_new = at91_usart_spi_remove,
};
module_platform_driver(at91_usart_spi_driver);
--
2.39.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] 42+ messages in thread* Re: [PATCH 04/87] spi: at91-usart: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
@ 2023-03-06 11:57 ` Claudiu.Beznea
0 siblings, 0 replies; 42+ messages in thread
From: Claudiu.Beznea @ 2023-03-06 11:57 UTC (permalink / raw)
To: u.kleine-koenig, radu_nicolae.pirea, broonie, Nicolas.Ferre,
alexandre.belloni
Cc: linux-spi, linux-arm-kernel, kernel
On 03.03.2023 19:19, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
> drivers/spi/spi-at91-usart.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> index fab9d223e24a..4fb3653b5941 100644
> --- a/drivers/spi/spi-at91-usart.c
> +++ b/drivers/spi/spi-at91-usart.c
> @@ -647,15 +647,13 @@ __maybe_unused static int at91_usart_spi_resume(struct device *dev)
> return spi_controller_resume(ctrl);
> }
>
> -static int at91_usart_spi_remove(struct platform_device *pdev)
> +static void at91_usart_spi_remove(struct platform_device *pdev)
> {
> struct spi_controller *ctlr = platform_get_drvdata(pdev);
> struct at91_usart_spi *aus = spi_controller_get_devdata(ctlr);
>
> at91_usart_spi_release_dma(ctlr);
> clk_disable_unprepare(aus->clk);
> -
> - return 0;
> }
>
> static const struct dev_pm_ops at91_usart_spi_pm_ops = {
> @@ -670,7 +668,7 @@ static struct platform_driver at91_usart_spi_driver = {
> .pm = &at91_usart_spi_pm_ops,
> },
> .probe = at91_usart_spi_probe,
> - .remove = at91_usart_spi_remove,
> + .remove_new = at91_usart_spi_remove,
> };
>
> module_platform_driver(at91_usart_spi_driver);
> --
> 2.39.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] 42+ messages in thread
* [PATCH 06/87] spi: atmel: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
2023-03-03 17:19 ` [PATCH 03/87] spi: aspeed-smc: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 04/87] spi: at91-usart: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-06 11:57 ` Claudiu.Beznea
2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
` (22 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea
Cc: linux-spi, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-atmel.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 5c5678f065f3..73f80c8ac2ff 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1596,7 +1596,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
return ret;
}
-static int atmel_spi_remove(struct platform_device *pdev)
+static void atmel_spi_remove(struct platform_device *pdev)
{
struct spi_controller *host = platform_get_drvdata(pdev);
struct atmel_spi *as = spi_controller_get_devdata(host);
@@ -1627,8 +1627,6 @@ static int atmel_spi_remove(struct platform_device *pdev)
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
static int atmel_spi_runtime_suspend(struct device *dev)
@@ -1712,7 +1710,7 @@ static struct platform_driver atmel_spi_driver = {
.of_match_table = atmel_spi_dt_ids,
},
.probe = atmel_spi_probe,
- .remove = atmel_spi_remove,
+ .remove_new = atmel_spi_remove,
};
module_platform_driver(atmel_spi_driver);
--
2.39.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] 42+ messages in thread* Re: [PATCH 06/87] spi: atmel: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
@ 2023-03-06 11:57 ` Claudiu.Beznea
0 siblings, 0 replies; 42+ messages in thread
From: Claudiu.Beznea @ 2023-03-06 11:57 UTC (permalink / raw)
To: u.kleine-koenig, tudor.ambarus, broonie, Nicolas.Ferre,
alexandre.belloni
Cc: linux-spi, linux-arm-kernel, kernel
On 03.03.2023 19:19, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
> drivers/spi/spi-atmel.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 5c5678f065f3..73f80c8ac2ff 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -1596,7 +1596,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int atmel_spi_remove(struct platform_device *pdev)
> +static void atmel_spi_remove(struct platform_device *pdev)
> {
> struct spi_controller *host = platform_get_drvdata(pdev);
> struct atmel_spi *as = spi_controller_get_devdata(host);
> @@ -1627,8 +1627,6 @@ static int atmel_spi_remove(struct platform_device *pdev)
>
> pm_runtime_put_noidle(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> -
> - return 0;
> }
>
> static int atmel_spi_runtime_suspend(struct device *dev)
> @@ -1712,7 +1710,7 @@ static struct platform_driver atmel_spi_driver = {
> .of_match_table = atmel_spi_dt_ids,
> },
> .probe = atmel_spi_probe,
> - .remove = atmel_spi_remove,
> + .remove_new = atmel_spi_remove,
> };
> module_platform_driver(atmel_spi_driver);
>
> --
> 2.39.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] 42+ messages in thread
* [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (2 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 06/87] spi: atmel: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:23 ` Florian Fainelli
2023-03-06 7:04 ` Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
` (21 subsequent siblings)
25 siblings, 2 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden
Cc: Broadcom internal kernel review list, linux-spi, linux-rpi-kernel,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-bcm2835.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 747e03228c48..be6050b513a9 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1398,7 +1398,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
return err;
}
-static int bcm2835_spi_remove(struct platform_device *pdev)
+static void bcm2835_spi_remove(struct platform_device *pdev)
{
struct spi_controller *ctlr = platform_get_drvdata(pdev);
struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
@@ -1414,17 +1414,11 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
clk_disable_unprepare(bs->clk);
-
- return 0;
}
static void bcm2835_spi_shutdown(struct platform_device *pdev)
{
- int ret;
-
- ret = bcm2835_spi_remove(pdev);
- if (ret)
- dev_err(&pdev->dev, "failed to shutdown\n");
+ rbcm2835_spi_remove(pdev);
}
static const struct of_device_id bcm2835_spi_match[] = {
@@ -1439,7 +1433,7 @@ static struct platform_driver bcm2835_spi_driver = {
.of_match_table = bcm2835_spi_match,
},
.probe = bcm2835_spi_probe,
- .remove = bcm2835_spi_remove,
+ .remove_new = bcm2835_spi_remove,
.shutdown = bcm2835_spi_shutdown,
};
module_platform_driver(bcm2835_spi_driver);
--
2.39.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] 42+ messages in thread* Re: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
@ 2023-03-03 17:23 ` Florian Fainelli
2023-03-06 7:04 ` Uwe Kleine-König
1 sibling, 0 replies; 42+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:23 UTC (permalink / raw)
To: Uwe Kleine-König, Mark Brown, Ray Jui, Scott Branden
Cc: Broadcom internal kernel review list, linux-spi, linux-rpi-kernel,
linux-arm-kernel, kernel
On 3/3/23 09:19, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
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] 42+ messages in thread
* Re: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
2023-03-03 17:23 ` Florian Fainelli
@ 2023-03-06 7:04 ` Uwe Kleine-König
2023-03-06 12:26 ` Mark Brown
1 sibling, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-06 7:04 UTC (permalink / raw)
To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden
Cc: kernel, Broadcom internal kernel review list, linux-rpi-kernel,
linux-arm-kernel, linux-spi
[-- Attachment #1.1: Type: text/plain, Size: 2777 bytes --]
On Fri, Mar 03, 2023 at 06:19:23PM +0100, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/spi/spi-bcm2835.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
> index 747e03228c48..be6050b513a9 100644
> --- a/drivers/spi/spi-bcm2835.c
> +++ b/drivers/spi/spi-bcm2835.c
> @@ -1398,7 +1398,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
> return err;
> }
>
> -static int bcm2835_spi_remove(struct platform_device *pdev)
> +static void bcm2835_spi_remove(struct platform_device *pdev)
> {
> struct spi_controller *ctlr = platform_get_drvdata(pdev);
> struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
> @@ -1414,17 +1414,11 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
> BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
>
> clk_disable_unprepare(bs->clk);
> -
> - return 0;
> }
>
> static void bcm2835_spi_shutdown(struct platform_device *pdev)
> {
> - int ret;
> -
> - ret = bcm2835_spi_remove(pdev);
> - if (ret)
> - dev_err(&pdev->dev, "failed to shutdown\n");
> + rbcm2835_spi_remove(pdev);
The kernel build bot found an issue here. There is an 'r' too
much. i.e. we need:
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index be6050b513a9..29445641fff0 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1418,7 +1418,7 @@ static void bcm2835_spi_remove(struct platform_device *pdev)
static void bcm2835_spi_shutdown(struct platform_device *pdev)
{
- rbcm2835_spi_remove(pdev);
+ bcm2835_spi_remove(pdev);
}
static const struct of_device_id bcm2835_spi_match[] = {
squashed into the original commit. (I had that uncommitted in my tree
while doing my build tests :-\)
@broonie: how should we proceed here? Is your tree already public and
you need a proper patch to fix this?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 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 related [flat|nested] 42+ messages in thread* Re: [PATCH 09/87] spi: bcm2835: Convert to platform remove callback returning void
2023-03-06 7:04 ` Uwe Kleine-König
@ 2023-03-06 12:26 ` Mark Brown
0 siblings, 0 replies; 42+ messages in thread
From: Mark Brown @ 2023-03-06 12:26 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Florian Fainelli, Ray Jui, Scott Branden, kernel,
Broadcom internal kernel review list, linux-rpi-kernel,
linux-arm-kernel, linux-spi
[-- Attachment #1.1: Type: text/plain, Size: 515 bytes --]
On Mon, Mar 06, 2023 at 08:04:26AM +0100, Uwe Kleine-König wrote:
> squashed into the original commit. (I had that uncommitted in my tree
> while doing my build tests :-\)
> @broonie: how should we proceed here? Is your tree already public and
> you need a proper patch to fix this?
I was just going to drop the commit since it also failed my CI for the
same reason, please send a new replacement.
Please don't add random characters to my name, for whatever reason it's
like you're misspelling it.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 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] 42+ messages in thread
* [PATCH 10/87] spi: bcm2835aux: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (3 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 09/87] spi: bcm2835: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:23 ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
` (20 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Florian Fainelli, Ray Jui, Scott Branden
Cc: Broadcom internal kernel review list, linux-spi, linux-rpi-kernel,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-bcm2835aux.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index e28521922330..7f2546fd900a 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -567,7 +567,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
return err;
}
-static int bcm2835aux_spi_remove(struct platform_device *pdev)
+static void bcm2835aux_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct bcm2835aux_spi *bs = spi_master_get_devdata(master);
@@ -580,8 +580,6 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev)
/* disable the HW block by releasing the clock */
clk_disable_unprepare(bs->clk);
-
- return 0;
}
static const struct of_device_id bcm2835aux_spi_match[] = {
@@ -596,7 +594,7 @@ static struct platform_driver bcm2835aux_spi_driver = {
.of_match_table = bcm2835aux_spi_match,
},
.probe = bcm2835aux_spi_probe,
- .remove = bcm2835aux_spi_remove,
+ .remove_new = bcm2835aux_spi_remove,
};
module_platform_driver(bcm2835aux_spi_driver);
--
2.39.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] 42+ messages in thread* Re: [PATCH 10/87] spi: bcm2835aux: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
@ 2023-03-03 17:23 ` Florian Fainelli
0 siblings, 0 replies; 42+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:23 UTC (permalink / raw)
To: Uwe Kleine-König, Mark Brown, Ray Jui, Scott Branden
Cc: Broadcom internal kernel review list, linux-spi, linux-rpi-kernel,
linux-arm-kernel, kernel
On 3/3/23 09:19, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
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] 42+ messages in thread
* [PATCH 13/87] spi: bcmbca-hsspi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (4 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 10/87] spi: bcm2835aux: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:24 ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
` (19 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: William Zhang, Kursad Oney, Jonas Gorski, Mark Brown, Anand Gore,
Florian Fainelli, Rafał Miłecki
Cc: Broadcom internal kernel review list, linux-spi, linux-arm-kernel,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-bcmbca-hsspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index 3f9e6131ad86..c7a44832bc9c 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -576,7 +576,7 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev)
return ret;
}
-static int bcmbca_hsspi_remove(struct platform_device *pdev)
+static void bcmbca_hsspi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct bcmbca_hsspi *bs = spi_master_get_devdata(master);
@@ -586,8 +586,6 @@ static int bcmbca_hsspi_remove(struct platform_device *pdev)
clk_disable_unprepare(bs->pll_clk);
clk_disable_unprepare(bs->clk);
sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -644,7 +642,7 @@ static struct platform_driver bcmbca_hsspi_driver = {
.of_match_table = bcmbca_hsspi_of_match,
},
.probe = bcmbca_hsspi_probe,
- .remove = bcmbca_hsspi_remove,
+ .remove_new = bcmbca_hsspi_remove,
};
module_platform_driver(bcmbca_hsspi_driver);
--
2.39.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] 42+ messages in thread* Re: [PATCH 13/87] spi: bcmbca-hsspi: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
@ 2023-03-03 17:24 ` Florian Fainelli
0 siblings, 0 replies; 42+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:24 UTC (permalink / raw)
To: Uwe Kleine-König, William Zhang, Kursad Oney, Jonas Gorski,
Mark Brown, Anand Gore, Rafał Miłecki
Cc: Broadcom internal kernel review list, linux-spi, linux-arm-kernel,
kernel
On 3/3/23 09:19, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
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] 42+ messages in thread
* [PATCH 14/87] spi: brcmstb-qspi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (5 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 13/87] spi: bcmbca-hsspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:24 ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
` (18 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Kamal Dasu, Mark Brown, Florian Fainelli
Cc: Broadcom internal kernel review list, linux-spi, linux-arm-kernel,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-brcmstb-qspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-brcmstb-qspi.c b/drivers/spi/spi-brcmstb-qspi.c
index de362b35718f..e1b137419f5c 100644
--- a/drivers/spi/spi-brcmstb-qspi.c
+++ b/drivers/spi/spi-brcmstb-qspi.c
@@ -21,16 +21,14 @@ static int brcmstb_qspi_probe(struct platform_device *pdev)
return bcm_qspi_probe(pdev, NULL);
}
-static int brcmstb_qspi_remove(struct platform_device *pdev)
+static void brcmstb_qspi_remove(struct platform_device *pdev)
{
bcm_qspi_remove(pdev);
-
- return 0;
}
static struct platform_driver brcmstb_qspi_driver = {
.probe = brcmstb_qspi_probe,
- .remove = brcmstb_qspi_remove,
+ .remove_new = brcmstb_qspi_remove,
.driver = {
.name = "brcmstb_qspi",
.pm = &bcm_qspi_pm_ops,
--
2.39.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] 42+ messages in thread* Re: [PATCH 14/87] spi: brcmstb-qspi: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
@ 2023-03-03 17:24 ` Florian Fainelli
0 siblings, 0 replies; 42+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:24 UTC (permalink / raw)
To: Uwe Kleine-König, Kamal Dasu, Mark Brown
Cc: Broadcom internal kernel review list, linux-spi, linux-arm-kernel,
kernel
On 3/3/23 09:19, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
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] 42+ messages in thread
* [PATCH 32/87] spi: iproc-qspi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (6 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 14/87] spi: brcmstb-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:26 ` Florian Fainelli
2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
` (17 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Kamal Dasu, Mark Brown, Ray Jui, Scott Branden
Cc: Broadcom internal kernel review list, linux-spi, linux-arm-kernel,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-iproc-qspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-iproc-qspi.c b/drivers/spi/spi-iproc-qspi.c
index 91cf8eb7213c..5980a0dbbccb 100644
--- a/drivers/spi/spi-iproc-qspi.c
+++ b/drivers/spi/spi-iproc-qspi.c
@@ -127,11 +127,9 @@ static int bcm_iproc_probe(struct platform_device *pdev)
return bcm_qspi_probe(pdev, soc_intc);
}
-static int bcm_iproc_remove(struct platform_device *pdev)
+static void bcm_iproc_remove(struct platform_device *pdev)
{
bcm_qspi_remove(pdev);
-
- return 0;
}
static const struct of_device_id bcm_iproc_of_match[] = {
@@ -143,7 +141,7 @@ MODULE_DEVICE_TABLE(of, bcm_iproc_of_match);
static struct platform_driver bcm_iproc_driver = {
.probe = bcm_iproc_probe,
- .remove = bcm_iproc_remove,
+ .remove_new = bcm_iproc_remove,
.driver = {
.name = "bcm_iproc",
.pm = &bcm_qspi_pm_ops,
--
2.39.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] 42+ messages in thread* Re: [PATCH 32/87] spi: iproc-qspi: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
@ 2023-03-03 17:26 ` Florian Fainelli
0 siblings, 0 replies; 42+ messages in thread
From: Florian Fainelli @ 2023-03-03 17:26 UTC (permalink / raw)
To: Uwe Kleine-König, Kamal Dasu, Mark Brown, Ray Jui,
Scott Branden
Cc: Broadcom internal kernel review list, linux-spi, linux-arm-kernel,
kernel
On 3/3/23 09:19, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
_______________________________________________
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] 42+ messages in thread
* [PATCH 34/87] spi: meson-spicc: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (7 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 32/87] spi: iproc-qspi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-04 21:43 ` Martin Blumenstingl
2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
` (16 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Neil Armstrong, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-spi, linux-arm-kernel,
linux-amlogic, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-meson-spicc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
index d47f2623a60f..b9f812837cd6 100644
--- a/drivers/spi/spi-meson-spicc.c
+++ b/drivers/spi/spi-meson-spicc.c
@@ -910,7 +910,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
return ret;
}
-static int meson_spicc_remove(struct platform_device *pdev)
+static void meson_spicc_remove(struct platform_device *pdev)
{
struct meson_spicc_device *spicc = platform_get_drvdata(pdev);
@@ -921,8 +921,6 @@ static int meson_spicc_remove(struct platform_device *pdev)
clk_disable_unprepare(spicc->pclk);
spi_master_put(spicc->master);
-
- return 0;
}
static const struct meson_spicc_data meson_spicc_gx_data = {
@@ -967,7 +965,7 @@ MODULE_DEVICE_TABLE(of, meson_spicc_of_match);
static struct platform_driver meson_spicc_driver = {
.probe = meson_spicc_probe,
- .remove = meson_spicc_remove,
+ .remove_new = meson_spicc_remove,
.driver = {
.name = "meson-spicc",
.of_match_table = of_match_ptr(meson_spicc_of_match),
--
2.39.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] 42+ messages in thread* Re: [PATCH 34/87] spi: meson-spicc: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
@ 2023-03-04 21:43 ` Martin Blumenstingl
0 siblings, 0 replies; 42+ messages in thread
From: Martin Blumenstingl @ 2023-03-04 21:43 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mark Brown, Neil Armstrong, Kevin Hilman, Jerome Brunet,
linux-spi, linux-arm-kernel, linux-amlogic, kernel
On Fri, Mar 3, 2023 at 6:21 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.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] 42+ messages in thread
* [PATCH 35/87] spi: meson-spifc: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (8 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 34/87] spi: meson-spicc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-04 21:43 ` Martin Blumenstingl
2023-03-03 17:19 ` [PATCH 41/87] spi: mtk-nor: " Uwe Kleine-König
` (15 subsequent siblings)
25 siblings, 1 reply; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Neil Armstrong, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-spi, linux-arm-kernel,
linux-amlogic, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-meson-spifc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-meson-spifc.c b/drivers/spi/spi-meson-spifc.c
index c8ed7815c4ba..06626f406f68 100644
--- a/drivers/spi/spi-meson-spifc.c
+++ b/drivers/spi/spi-meson-spifc.c
@@ -355,7 +355,7 @@ static int meson_spifc_probe(struct platform_device *pdev)
return ret;
}
-static int meson_spifc_remove(struct platform_device *pdev)
+static void meson_spifc_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct meson_spifc *spifc = spi_master_get_devdata(master);
@@ -363,8 +363,6 @@ static int meson_spifc_remove(struct platform_device *pdev)
pm_runtime_get_sync(&pdev->dev);
clk_disable_unprepare(spifc->clk);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -442,7 +440,7 @@ MODULE_DEVICE_TABLE(of, meson_spifc_dt_match);
static struct platform_driver meson_spifc_driver = {
.probe = meson_spifc_probe,
- .remove = meson_spifc_remove,
+ .remove_new = meson_spifc_remove,
.driver = {
.name = "meson-spifc",
.of_match_table = of_match_ptr(meson_spifc_dt_match),
--
2.39.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] 42+ messages in thread* Re: [PATCH 35/87] spi: meson-spifc: Convert to platform remove callback returning void
2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
@ 2023-03-04 21:43 ` Martin Blumenstingl
0 siblings, 0 replies; 42+ messages in thread
From: Martin Blumenstingl @ 2023-03-04 21:43 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mark Brown, Neil Armstrong, Kevin Hilman, Jerome Brunet,
linux-spi, linux-arm-kernel, linux-amlogic, kernel
On Fri, Mar 3, 2023 at 6:21 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.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] 42+ messages in thread
* [PATCH 41/87] spi: mtk-nor: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (9 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 35/87] spi: meson-spifc: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 42/87] spi: mtk-snfi: " Uwe Kleine-König
` (14 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-spi, linux-arm-kernel,
linux-mediatek, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-mtk-nor.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index aad92a58c4b8..baa7a5353987 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -934,7 +934,7 @@ static int mtk_nor_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_nor_remove(struct platform_device *pdev)
+static void mtk_nor_remove(struct platform_device *pdev)
{
struct spi_controller *ctlr = dev_get_drvdata(&pdev->dev);
struct mtk_nor *sp = spi_controller_get_devdata(ctlr);
@@ -944,8 +944,6 @@ static int mtk_nor_remove(struct platform_device *pdev)
pm_runtime_dont_use_autosuspend(&pdev->dev);
mtk_nor_disable_clk(sp);
-
- return 0;
}
static int __maybe_unused mtk_nor_runtime_suspend(struct device *dev)
@@ -999,7 +997,7 @@ static struct platform_driver mtk_nor_driver = {
.pm = &mtk_nor_pm_ops,
},
.probe = mtk_nor_probe,
- .remove = mtk_nor_remove,
+ .remove_new = mtk_nor_remove,
};
module_platform_driver(mtk_nor_driver);
--
2.39.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] 42+ messages in thread* [PATCH 42/87] spi: mtk-snfi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (10 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 41/87] spi: mtk-nor: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:19 ` [PATCH 44/87] spi: mxs: " Uwe Kleine-König
` (13 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-spi, linux-arm-kernel,
linux-mediatek, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-mtk-snfi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c
index f3f95eb37365..bed8317cd205 100644
--- a/drivers/spi/spi-mtk-snfi.c
+++ b/drivers/spi/spi-mtk-snfi.c
@@ -1506,7 +1506,7 @@ static int mtk_snand_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_snand_remove(struct platform_device *pdev)
+static void mtk_snand_remove(struct platform_device *pdev)
{
struct spi_controller *ctlr = platform_get_drvdata(pdev);
struct mtk_snand *ms = spi_controller_get_devdata(ctlr);
@@ -1515,12 +1515,11 @@ static int mtk_snand_remove(struct platform_device *pdev)
mtk_snand_disable_clk(ms);
mtk_ecc_release(ms->ecc);
kfree(ms->buf);
- return 0;
}
static struct platform_driver mtk_snand_driver = {
.probe = mtk_snand_probe,
- .remove = mtk_snand_remove,
+ .remove_new = mtk_snand_remove,
.driver = {
.name = "mtk-snand",
.of_match_table = mtk_snand_ids,
--
2.39.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] 42+ messages in thread* [PATCH 44/87] spi: mxs: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (11 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 42/87] spi: mtk-snfi: " Uwe Kleine-König
@ 2023-03-03 17:19 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 55/87] spi: pxa2xx: " Uwe Kleine-König
` (12 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:19 UTC (permalink / raw)
To: Mark Brown, Shawn Guo, Sascha Hauer
Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, linux-spi,
linux-arm-kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-mxs.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 55178579f3c6..10fb31a5e409 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -638,7 +638,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
return ret;
}
-static int mxs_spi_remove(struct platform_device *pdev)
+static void mxs_spi_remove(struct platform_device *pdev)
{
struct spi_master *master;
struct mxs_spi *spi;
@@ -653,13 +653,11 @@ static int mxs_spi_remove(struct platform_device *pdev)
mxs_spi_runtime_suspend(&pdev->dev);
dma_release_channel(ssp->dmach);
-
- return 0;
}
static struct platform_driver mxs_spi_driver = {
.probe = mxs_spi_probe,
- .remove = mxs_spi_remove,
+ .remove_new = mxs_spi_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = mxs_spi_dt_ids,
--
2.39.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] 42+ messages in thread* [PATCH 55/87] spi: pxa2xx: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (12 preceding siblings ...)
2023-03-03 17:19 ` [PATCH 44/87] spi: mxs: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 58/87] spi: rockchip-sfc: " Uwe Kleine-König
` (11 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Mark Brown
Cc: linux-arm-kernel, linux-spi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-pxa2xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 32cc82a89ec1..a75ba2993f3c 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1659,7 +1659,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
return status;
}
-static int pxa2xx_spi_remove(struct platform_device *pdev)
+static void pxa2xx_spi_remove(struct platform_device *pdev)
{
struct driver_data *drv_data = platform_get_drvdata(pdev);
struct ssp_device *ssp = drv_data->ssp;
@@ -1684,8 +1684,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
/* Release SSP */
pxa_ssp_free(ssp);
-
- return 0;
}
static int pxa2xx_spi_suspend(struct device *dev)
@@ -1770,7 +1768,7 @@ static struct platform_driver driver = {
.of_match_table = of_match_ptr(pxa2xx_spi_of_match),
},
.probe = pxa2xx_spi_probe,
- .remove = pxa2xx_spi_remove,
+ .remove_new = pxa2xx_spi_remove,
};
static int __init pxa2xx_spi_init(void)
--
2.39.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] 42+ messages in thread* [PATCH 58/87] spi: rockchip-sfc: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (13 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 55/87] spi: pxa2xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 59/87] spi: rockchip: " Uwe Kleine-König
` (10 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Heiko Stuebner
Cc: linux-spi, linux-arm-kernel, linux-rockchip, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-rockchip-sfc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c
index bd87d3c92dd3..80e1ee110d31 100644
--- a/drivers/spi/spi-rockchip-sfc.c
+++ b/drivers/spi/spi-rockchip-sfc.c
@@ -656,7 +656,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev)
return ret;
}
-static int rockchip_sfc_remove(struct platform_device *pdev)
+static void rockchip_sfc_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct rockchip_sfc *sfc = platform_get_drvdata(pdev);
@@ -665,8 +665,6 @@ static int rockchip_sfc_remove(struct platform_device *pdev)
clk_disable_unprepare(sfc->clk);
clk_disable_unprepare(sfc->hclk);
-
- return 0;
}
static const struct of_device_id rockchip_sfc_dt_ids[] = {
@@ -681,7 +679,7 @@ static struct platform_driver rockchip_sfc_driver = {
.of_match_table = rockchip_sfc_dt_ids,
},
.probe = rockchip_sfc_probe,
- .remove = rockchip_sfc_remove,
+ .remove_new = rockchip_sfc_remove,
};
module_platform_driver(rockchip_sfc_driver);
--
2.39.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] 42+ messages in thread* [PATCH 59/87] spi: rockchip: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (14 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 58/87] spi: rockchip-sfc: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 62/87] spi: s3c64xx: " Uwe Kleine-König
` (9 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Heiko Stuebner
Cc: linux-spi, linux-arm-kernel, linux-rockchip, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-rockchip.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 79242dc5272d..8888a5ff7b2f 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -947,7 +947,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
return ret;
}
-static int rockchip_spi_remove(struct platform_device *pdev)
+static void rockchip_spi_remove(struct platform_device *pdev)
{
struct spi_controller *ctlr = spi_controller_get(platform_get_drvdata(pdev));
struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
@@ -967,8 +967,6 @@ static int rockchip_spi_remove(struct platform_device *pdev)
dma_release_channel(ctlr->dma_rx);
spi_controller_put(ctlr);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -1076,7 +1074,7 @@ static struct platform_driver rockchip_spi_driver = {
.of_match_table = of_match_ptr(rockchip_spi_dt_match),
},
.probe = rockchip_spi_probe,
- .remove = rockchip_spi_remove,
+ .remove_new = rockchip_spi_remove,
};
module_platform_driver(rockchip_spi_driver);
--
2.39.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] 42+ messages in thread* [PATCH 62/87] spi: s3c64xx: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (15 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 59/87] spi: rockchip: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 68/87] spi: slave-mt27xx: " Uwe Kleine-König
` (8 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Krzysztof Kozlowski, Andi Shyti, Mark Brown
Cc: Alim Akhtar, linux-spi, linux-samsung-soc, linux-arm-kernel,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-s3c64xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 71d324ec9a70..cc69f8ffdbdc 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1286,7 +1286,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
return ret;
}
-static int s3c64xx_spi_remove(struct platform_device *pdev)
+static void s3c64xx_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(master);
@@ -1309,8 +1309,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -1531,7 +1529,7 @@ static struct platform_driver s3c64xx_spi_driver = {
.of_match_table = of_match_ptr(s3c64xx_spi_dt_match),
},
.probe = s3c64xx_spi_probe,
- .remove = s3c64xx_spi_remove,
+ .remove_new = s3c64xx_spi_remove,
.id_table = s3c64xx_spi_driver_ids,
};
MODULE_ALIAS("platform:s3c64xx-spi");
--
2.39.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] 42+ messages in thread* [PATCH 68/87] spi: slave-mt27xx: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (16 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 62/87] spi: s3c64xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 72/87] spi: stm32-qspi: " Uwe Kleine-König
` (7 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-spi, linux-arm-kernel,
linux-mediatek, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-slave-mt27xx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-slave-mt27xx.c b/drivers/spi/spi-slave-mt27xx.c
index f199a6c4738a..4e4d426bfb43 100644
--- a/drivers/spi/spi-slave-mt27xx.c
+++ b/drivers/spi/spi-slave-mt27xx.c
@@ -474,11 +474,9 @@ static int mtk_spi_slave_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_spi_slave_remove(struct platform_device *pdev)
+static void mtk_spi_slave_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -560,7 +558,7 @@ static struct platform_driver mtk_spi_slave_driver = {
.of_match_table = mtk_spi_slave_of_match,
},
.probe = mtk_spi_slave_probe,
- .remove = mtk_spi_slave_remove,
+ .remove_new = mtk_spi_slave_remove,
};
module_platform_driver(mtk_spi_slave_driver);
--
2.39.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] 42+ messages in thread* [PATCH 72/87] spi: stm32-qspi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (17 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 68/87] spi: slave-mt27xx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 73/87] spi: stm32: " Uwe Kleine-König
` (6 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Maxime Coquelin, Alexandre Torgue
Cc: linux-spi, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-stm32-qspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c
index 9131660c1afb..29125af0afdb 100644
--- a/drivers/spi/spi-stm32-qspi.c
+++ b/drivers/spi/spi-stm32-qspi.c
@@ -888,7 +888,7 @@ static int stm32_qspi_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_qspi_remove(struct platform_device *pdev)
+static void stm32_qspi_remove(struct platform_device *pdev)
{
struct stm32_qspi *qspi = platform_get_drvdata(pdev);
@@ -903,8 +903,6 @@ static int stm32_qspi_remove(struct platform_device *pdev)
pm_runtime_set_suspended(qspi->dev);
pm_runtime_dont_use_autosuspend(qspi->dev);
clk_disable_unprepare(qspi->clk);
-
- return 0;
}
static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
@@ -968,7 +966,7 @@ MODULE_DEVICE_TABLE(of, stm32_qspi_match);
static struct platform_driver stm32_qspi_driver = {
.probe = stm32_qspi_probe,
- .remove = stm32_qspi_remove,
+ .remove_new = stm32_qspi_remove,
.driver = {
.name = "stm32-qspi",
.of_match_table = stm32_qspi_match,
--
2.39.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] 42+ messages in thread* [PATCH 73/87] spi: stm32: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (18 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 72/87] spi: stm32-qspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
` (5 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Alain Volmat, Mark Brown, Maxime Coquelin, Alexandre Torgue
Cc: linux-spi, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-stm32.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index def09cf0dc14..9ccb52296e57 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -1922,7 +1922,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_spi_remove(struct platform_device *pdev)
+static void stm32_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct stm32_spi *spi = spi_master_get_devdata(master);
@@ -1946,8 +1946,6 @@ static int stm32_spi_remove(struct platform_device *pdev)
pinctrl_pm_select_sleep_state(&pdev->dev);
-
- return 0;
}
static int __maybe_unused stm32_spi_runtime_suspend(struct device *dev)
@@ -2023,7 +2021,7 @@ static const struct dev_pm_ops stm32_spi_pm_ops = {
static struct platform_driver stm32_spi_driver = {
.probe = stm32_spi_probe,
- .remove = stm32_spi_remove,
+ .remove_new = stm32_spi_remove,
.driver = {
.name = DRIVER_NAME,
.pm = &stm32_spi_pm_ops,
--
2.39.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] 42+ messages in thread* [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (19 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 73/87] spi: stm32: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:29 ` Andre Przywara
2023-03-14 20:11 ` Jernej Škrabec
2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
` (4 subsequent siblings)
25 siblings, 2 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: linux-spi, linux-arm-kernel, linux-sunxi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-sun4i.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index 6000d0761206..994d0fb50e68 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device *pdev)
return ret;
}
-static int sun4i_spi_remove(struct platform_device *pdev)
+static void sun4i_spi_remove(struct platform_device *pdev)
{
pm_runtime_force_suspend(&pdev->dev);
-
- return 0;
}
static const struct of_device_id sun4i_spi_match[] = {
@@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
static struct platform_driver sun4i_spi_driver = {
.probe = sun4i_spi_probe,
- .remove = sun4i_spi_remove,
+ .remove_new = sun4i_spi_remove,
.driver = {
.name = "sun4i-spi",
.of_match_table = sun4i_spi_match,
--
2.39.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] 42+ messages in thread* Re: [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void
2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
@ 2023-03-03 17:29 ` Andre Przywara
2023-03-14 20:11 ` Jernej Škrabec
1 sibling, 0 replies; 42+ messages in thread
From: Andre Przywara @ 2023-03-03 17:29 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
linux-spi, linux-arm-kernel, linux-sunxi, kernel
On Fri, 3 Mar 2023 18:20:28 +0100
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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> drivers/spi/spi-sun4i.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
> index 6000d0761206..994d0fb50e68 100644
> --- a/drivers/spi/spi-sun4i.c
> +++ b/drivers/spi/spi-sun4i.c
> @@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int sun4i_spi_remove(struct platform_device *pdev)
> +static void sun4i_spi_remove(struct platform_device *pdev)
> {
> pm_runtime_force_suspend(&pdev->dev);
> -
> - return 0;
> }
>
> static const struct of_device_id sun4i_spi_match[] = {
> @@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
>
> static struct platform_driver sun4i_spi_driver = {
> .probe = sun4i_spi_probe,
> - .remove = sun4i_spi_remove,
> + .remove_new = sun4i_spi_remove,
> .driver = {
> .name = "sun4i-spi",
> .of_match_table = sun4i_spi_match,
_______________________________________________
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] 42+ messages in thread* Re: [PATCH 74/87] spi: sun4i: Convert to platform remove callback returning void
2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
2023-03-03 17:29 ` Andre Przywara
@ 2023-03-14 20:11 ` Jernej Škrabec
1 sibling, 0 replies; 42+ messages in thread
From: Jernej Škrabec @ 2023-03-14 20:11 UTC (permalink / raw)
To: Mark Brown, Chen-Yu Tsai, Samuel Holland, Uwe Kleine-König
Cc: linux-spi, linux-arm-kernel, linux-sunxi, kernel
Dne petek, 03. marec 2023 ob 18:20:28 CET je Uwe Kleine-König napisal(a):
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> drivers/spi/spi-sun4i.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
> index 6000d0761206..994d0fb50e68 100644
> --- a/drivers/spi/spi-sun4i.c
> +++ b/drivers/spi/spi-sun4i.c
> @@ -516,11 +516,9 @@ static int sun4i_spi_probe(struct platform_device
> *pdev) return ret;
> }
>
> -static int sun4i_spi_remove(struct platform_device *pdev)
> +static void sun4i_spi_remove(struct platform_device *pdev)
> {
> pm_runtime_force_suspend(&pdev->dev);
> -
> - return 0;
> }
>
> static const struct of_device_id sun4i_spi_match[] = {
> @@ -536,7 +534,7 @@ static const struct dev_pm_ops sun4i_spi_pm_ops = {
>
> static struct platform_driver sun4i_spi_driver = {
> .probe = sun4i_spi_probe,
> - .remove = sun4i_spi_remove,
> + .remove_new = sun4i_spi_remove,
> .driver = {
> .name = "sun4i-spi",
> .of_match_table = sun4i_spi_match,
_______________________________________________
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] 42+ messages in thread
* [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (20 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 74/87] spi: sun4i: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:30 ` Andre Przywara
2023-03-14 20:12 ` Jernej Škrabec
2023-03-03 17:20 ` [PATCH 83/87] spi: uniphier: " Uwe Kleine-König
` (3 subsequent siblings)
25 siblings, 2 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: linux-spi, linux-arm-kernel, linux-sunxi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-sun6i.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
index 23ad052528db..43c29afea6bb 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
return ret;
}
-static int sun6i_spi_remove(struct platform_device *pdev)
+static void sun6i_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
@@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device *pdev)
dma_release_channel(master->dma_tx);
if (master->dma_rx)
dma_release_channel(master->dma_rx);
- return 0;
}
static const struct of_device_id sun6i_spi_match[] = {
@@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = {
static struct platform_driver sun6i_spi_driver = {
.probe = sun6i_spi_probe,
- .remove = sun6i_spi_remove,
+ .remove_new = sun6i_spi_remove,
.driver = {
.name = "sun6i-spi",
.of_match_table = sun6i_spi_match,
--
2.39.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] 42+ messages in thread* Re: [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void
2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
@ 2023-03-03 17:30 ` Andre Przywara
2023-03-14 20:12 ` Jernej Škrabec
1 sibling, 0 replies; 42+ messages in thread
From: Andre Przywara @ 2023-03-03 17:30 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mark Brown, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
linux-spi, linux-arm-kernel, linux-sunxi, kernel
On Fri, 3 Mar 2023 18:20:29 +0100
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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> drivers/spi/spi-sun6i.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
> index 23ad052528db..43c29afea6bb 100644
> --- a/drivers/spi/spi-sun6i.c
> +++ b/drivers/spi/spi-sun6i.c
> @@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int sun6i_spi_remove(struct platform_device *pdev)
> +static void sun6i_spi_remove(struct platform_device *pdev)
> {
> struct spi_master *master = platform_get_drvdata(pdev);
>
> @@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device *pdev)
> dma_release_channel(master->dma_tx);
> if (master->dma_rx)
> dma_release_channel(master->dma_rx);
> - return 0;
> }
>
> static const struct of_device_id sun6i_spi_match[] = {
> @@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = {
>
> static struct platform_driver sun6i_spi_driver = {
> .probe = sun6i_spi_probe,
> - .remove = sun6i_spi_remove,
> + .remove_new = sun6i_spi_remove,
> .driver = {
> .name = "sun6i-spi",
> .of_match_table = sun6i_spi_match,
_______________________________________________
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] 42+ messages in thread* Re: [PATCH 75/87] spi: sun6i: Convert to platform remove callback returning void
2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
2023-03-03 17:30 ` Andre Przywara
@ 2023-03-14 20:12 ` Jernej Škrabec
1 sibling, 0 replies; 42+ messages in thread
From: Jernej Škrabec @ 2023-03-14 20:12 UTC (permalink / raw)
To: Mark Brown, Chen-Yu Tsai, Samuel Holland, Uwe Kleine-König
Cc: linux-spi, linux-arm-kernel, linux-sunxi, kernel
Dne petek, 03. marec 2023 ob 18:20:29 CET je Uwe Kleine-König napisal(a):
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> drivers/spi/spi-sun6i.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
> index 23ad052528db..43c29afea6bb 100644
> --- a/drivers/spi/spi-sun6i.c
> +++ b/drivers/spi/spi-sun6i.c
> @@ -683,7 +683,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int sun6i_spi_remove(struct platform_device *pdev)
> +static void sun6i_spi_remove(struct platform_device *pdev)
> {
> struct spi_master *master = platform_get_drvdata(pdev);
>
> @@ -693,7 +693,6 @@ static int sun6i_spi_remove(struct platform_device
> *pdev) dma_release_channel(master->dma_tx);
> if (master->dma_rx)
> dma_release_channel(master->dma_rx);
> - return 0;
> }
>
> static const struct of_device_id sun6i_spi_match[] = {
> @@ -710,7 +709,7 @@ static const struct dev_pm_ops sun6i_spi_pm_ops = {
>
> static struct platform_driver sun6i_spi_driver = {
> .probe = sun6i_spi_probe,
> - .remove = sun6i_spi_remove,
> + .remove_new = sun6i_spi_remove,
> .driver = {
> .name = "sun6i-spi",
> .of_match_table = sun6i_spi_match,
_______________________________________________
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] 42+ messages in thread
* [PATCH 83/87] spi: uniphier: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (21 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 75/87] spi: sun6i: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 84/87] spi: xilinx: " Uwe Kleine-König
` (2 subsequent siblings)
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Kunihiko Hayashi, Masami Hiramatsu
Cc: linux-spi, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-uniphier.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-uniphier.c b/drivers/spi/spi-uniphier.c
index cc0da4822231..f5344527af0b 100644
--- a/drivers/spi/spi-uniphier.c
+++ b/drivers/spi/spi-uniphier.c
@@ -775,7 +775,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
return ret;
}
-static int uniphier_spi_remove(struct platform_device *pdev)
+static void uniphier_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct uniphier_spi_priv *priv = spi_master_get_devdata(master);
@@ -786,8 +786,6 @@ static int uniphier_spi_remove(struct platform_device *pdev)
dma_release_channel(master->dma_rx);
clk_disable_unprepare(priv->clk);
-
- return 0;
}
static const struct of_device_id uniphier_spi_match[] = {
@@ -798,7 +796,7 @@ MODULE_DEVICE_TABLE(of, uniphier_spi_match);
static struct platform_driver uniphier_spi_driver = {
.probe = uniphier_spi_probe,
- .remove = uniphier_spi_remove,
+ .remove_new = uniphier_spi_remove,
.driver = {
.name = "uniphier-spi",
.of_match_table = uniphier_spi_match,
--
2.39.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] 42+ messages in thread* [PATCH 84/87] spi: xilinx: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (22 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 83/87] spi: uniphier: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 86/87] spi: zynq-qspi: " Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 87/87] spi: zynqmp-gqspi: " Uwe Kleine-König
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Michal Simek; +Cc: linux-spi, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-xilinx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 1411548f4255..d2f9eea5e093 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -504,7 +504,7 @@ static int xilinx_spi_probe(struct platform_device *pdev)
return 0;
}
-static int xilinx_spi_remove(struct platform_device *pdev)
+static void xilinx_spi_remove(struct platform_device *pdev)
{
struct spi_master *master = platform_get_drvdata(pdev);
struct xilinx_spi *xspi = spi_master_get_devdata(master);
@@ -518,8 +518,6 @@ static int xilinx_spi_remove(struct platform_device *pdev)
xspi->write_fn(0, regs_base + XIPIF_V123B_DGIER_OFFSET);
spi_master_put(xspi->bitbang.master);
-
- return 0;
}
/* work with hotplug and coldplug */
@@ -527,7 +525,7 @@ MODULE_ALIAS("platform:" XILINX_SPI_NAME);
static struct platform_driver xilinx_spi_driver = {
.probe = xilinx_spi_probe,
- .remove = xilinx_spi_remove,
+ .remove_new = xilinx_spi_remove,
.driver = {
.name = XILINX_SPI_NAME,
.of_match_table = xilinx_spi_of_match,
--
2.39.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] 42+ messages in thread* [PATCH 86/87] spi: zynq-qspi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (23 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 84/87] spi: xilinx: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
2023-03-03 17:20 ` [PATCH 87/87] spi: zynqmp-gqspi: " Uwe Kleine-König
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Michal Simek; +Cc: linux-spi, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-zynq-qspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index 78f31b61a2aa..8558c0fe3775 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -741,7 +741,7 @@ static int zynq_qspi_probe(struct platform_device *pdev)
*
* Return: 0 on success and error value on failure
*/
-static int zynq_qspi_remove(struct platform_device *pdev)
+static void zynq_qspi_remove(struct platform_device *pdev)
{
struct zynq_qspi *xqspi = platform_get_drvdata(pdev);
@@ -749,8 +749,6 @@ static int zynq_qspi_remove(struct platform_device *pdev)
clk_disable_unprepare(xqspi->refclk);
clk_disable_unprepare(xqspi->pclk);
-
- return 0;
}
static const struct of_device_id zynq_qspi_of_match[] = {
@@ -765,7 +763,7 @@ MODULE_DEVICE_TABLE(of, zynq_qspi_of_match);
*/
static struct platform_driver zynq_qspi_driver = {
.probe = zynq_qspi_probe,
- .remove = zynq_qspi_remove,
+ .remove_new = zynq_qspi_remove,
.driver = {
.name = "zynq-qspi",
.of_match_table = zynq_qspi_of_match,
--
2.39.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] 42+ messages in thread* [PATCH 87/87] spi: zynqmp-gqspi: Convert to platform remove callback returning void
[not found] <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de>
` (24 preceding siblings ...)
2023-03-03 17:20 ` [PATCH 86/87] spi: zynq-qspi: " Uwe Kleine-König
@ 2023-03-03 17:20 ` Uwe Kleine-König
25 siblings, 0 replies; 42+ messages in thread
From: Uwe Kleine-König @ 2023-03-03 17:20 UTC (permalink / raw)
To: Mark Brown, Michal Simek; +Cc: linux-spi, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/spi-zynqmp-gqspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c
index 95ff15665d44..270d28a3f8eb 100644
--- a/drivers/spi/spi-zynqmp-gqspi.c
+++ b/drivers/spi/spi-zynqmp-gqspi.c
@@ -1364,7 +1364,7 @@ static int zynqmp_qspi_probe(struct platform_device *pdev)
*
* Return: 0 Always
*/
-static int zynqmp_qspi_remove(struct platform_device *pdev)
+static void zynqmp_qspi_remove(struct platform_device *pdev)
{
struct zynqmp_qspi *xqspi = platform_get_drvdata(pdev);
@@ -1373,15 +1373,13 @@ static int zynqmp_qspi_remove(struct platform_device *pdev)
clk_disable_unprepare(xqspi->pclk);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
MODULE_DEVICE_TABLE(of, zynqmp_qspi_of_match);
static struct platform_driver zynqmp_qspi_driver = {
.probe = zynqmp_qspi_probe,
- .remove = zynqmp_qspi_remove,
+ .remove_new = zynqmp_qspi_remove,
.driver = {
.name = "zynqmp-qspi",
.of_match_table = zynqmp_qspi_of_match,
--
2.39.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] 42+ messages in thread