* [PATCH 01/49] iio: accel: hid-sensor-accel-3d: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 02/49] iio: adc: ab8500-gpadc: " Uwe Kleine-König
` (50 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/accel/hid-sensor-accel-3d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 5eac7ea19993..9b7a73a4c48a 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -422,7 +422,7 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_accel_3d_remove(struct platform_device *pdev)
+static void hid_accel_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -431,8 +431,6 @@ static int hid_accel_3d_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, hsdev->usage);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &accel_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_accel_3d_ids[] = {
@@ -454,7 +452,7 @@ static struct platform_driver hid_accel_3d_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_accel_3d_probe,
- .remove = hid_accel_3d_remove,
+ .remove_new = hid_accel_3d_remove,
};
module_platform_driver(hid_accel_3d_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 02/49] iio: adc: ab8500-gpadc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 01/49] iio: accel: hid-sensor-accel-3d: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 03/49] iio: adc: at91-sama5d2: " Uwe Kleine-König
` (49 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Linus Walleij, Lars-Peter Clausen, linux-arm-kernel, linux-iio,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/ab8500-gpadc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c
index 3b1bdd0b531d..80645fee79a4 100644
--- a/drivers/iio/adc/ab8500-gpadc.c
+++ b/drivers/iio/adc/ab8500-gpadc.c
@@ -1179,7 +1179,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
return ret;
}
-static int ab8500_gpadc_remove(struct platform_device *pdev)
+static void ab8500_gpadc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct ab8500_gpadc *gpadc = iio_priv(indio_dev);
@@ -1188,8 +1188,6 @@ static int ab8500_gpadc_remove(struct platform_device *pdev)
pm_runtime_put_noidle(gpadc->dev);
pm_runtime_disable(gpadc->dev);
regulator_disable(gpadc->vddadc);
-
- return 0;
}
static DEFINE_RUNTIME_DEV_PM_OPS(ab8500_gpadc_pm_ops,
@@ -1198,7 +1196,7 @@ static DEFINE_RUNTIME_DEV_PM_OPS(ab8500_gpadc_pm_ops,
static struct platform_driver ab8500_gpadc_driver = {
.probe = ab8500_gpadc_probe,
- .remove = ab8500_gpadc_remove,
+ .remove_new = ab8500_gpadc_remove,
.driver = {
.name = "ab8500-gpadc",
.pm = pm_ptr(&ab8500_gpadc_pm_ops),
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 03/49] iio: adc: at91-sama5d2: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 01/49] iio: accel: hid-sensor-accel-3d: " Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 02/49] iio: adc: ab8500-gpadc: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 04/49] iio: adc: at91: " Uwe Kleine-König
` (48 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Eugen Hristev, Lars-Peter Clausen, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, linux-iio, linux-arm-kernel,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/at91-sama5d2_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index df67b63ccf69..d7fd21e7c6e2 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -2486,7 +2486,7 @@ static int at91_adc_probe(struct platform_device *pdev)
return ret;
}
-static int at91_adc_remove(struct platform_device *pdev)
+static void at91_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct at91_adc_state *st = iio_priv(indio_dev);
@@ -2501,8 +2501,6 @@ static int at91_adc_remove(struct platform_device *pdev)
regulator_disable(st->vref);
regulator_disable(st->reg);
-
- return 0;
}
static int at91_adc_suspend(struct device *dev)
@@ -2627,7 +2625,7 @@ MODULE_DEVICE_TABLE(of, at91_adc_dt_match);
static struct platform_driver at91_adc_driver = {
.probe = at91_adc_probe,
- .remove = at91_adc_remove,
+ .remove_new = at91_adc_remove,
.driver = {
.name = "at91-sama5d2_adc",
.of_match_table = at91_adc_dt_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 04/49] iio: adc: at91: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 03/49] iio: adc: at91-sama5d2: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 05/49] iio: adc: axp20x: " Uwe Kleine-König
` (47 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Jinjie Ruan, Rob Herring, Heiko Stuebner,
Yang Yingliang, linux-iio, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/at91_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 200c4599530b..eb501e3c86a5 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -1185,7 +1185,7 @@ static int at91_adc_probe(struct platform_device *pdev)
return ret;
}
-static int at91_adc_remove(struct platform_device *pdev)
+static void at91_adc_remove(struct platform_device *pdev)
{
struct iio_dev *idev = platform_get_drvdata(pdev);
struct at91_adc_state *st = iio_priv(idev);
@@ -1197,8 +1197,6 @@ static int at91_adc_remove(struct platform_device *pdev)
} else {
at91_ts_unregister(st);
}
-
- return 0;
}
static int at91_adc_suspend(struct device *dev)
@@ -1348,7 +1346,7 @@ MODULE_DEVICE_TABLE(of, at91_adc_dt_ids);
static struct platform_driver at91_adc_driver = {
.probe = at91_adc_probe,
- .remove = at91_adc_remove,
+ .remove_new = at91_adc_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = at91_adc_dt_ids,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 05/49] iio: adc: axp20x: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (3 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 04/49] iio: adc: at91: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 06/49] iio: adc: bcm_iproc: " Uwe Kleine-König
` (46 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Chen-Yu Tsai, Aidan MacDonald,
Andy Shevchenko, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/axp20x_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c
index 75bda94dbce1..d6c51b0f48e3 100644
--- a/drivers/iio/adc/axp20x_adc.c
+++ b/drivers/iio/adc/axp20x_adc.c
@@ -745,7 +745,7 @@ static int axp20x_probe(struct platform_device *pdev)
return ret;
}
-static int axp20x_remove(struct platform_device *pdev)
+static void axp20x_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct axp20x_adc_iio *info = iio_priv(indio_dev);
@@ -757,8 +757,6 @@ static int axp20x_remove(struct platform_device *pdev)
if (info->data->adc_en2_mask)
regmap_write(info->regmap, AXP20X_ADC_EN2, 0);
-
- return 0;
}
static struct platform_driver axp20x_adc_driver = {
@@ -768,7 +766,7 @@ static struct platform_driver axp20x_adc_driver = {
},
.id_table = axp20x_adc_id_match,
.probe = axp20x_probe,
- .remove = axp20x_remove,
+ .remove_new = axp20x_remove,
};
module_platform_driver(axp20x_adc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 06/49] iio: adc: bcm_iproc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (4 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 05/49] iio: adc: axp20x: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 18:54 ` Florian Fainelli
2023-09-19 17:48 ` [PATCH 07/49] iio: adc: dln2: " Uwe Kleine-König
` (45 subsequent siblings)
51 siblings, 1 reply; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Ruan Jinjie, linux-iio,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/bcm_iproc_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c
index 0d6885413a7e..5bc514bd5ebc 100644
--- a/drivers/iio/adc/bcm_iproc_adc.c
+++ b/drivers/iio/adc/bcm_iproc_adc.c
@@ -594,7 +594,7 @@ static int iproc_adc_probe(struct platform_device *pdev)
return ret;
}
-static int iproc_adc_remove(struct platform_device *pdev)
+static void iproc_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct iproc_adc_priv *adc_priv = iio_priv(indio_dev);
@@ -602,8 +602,6 @@ static int iproc_adc_remove(struct platform_device *pdev)
iio_device_unregister(indio_dev);
iproc_adc_disable(indio_dev);
clk_disable_unprepare(adc_priv->adc_clk);
-
- return 0;
}
static const struct of_device_id iproc_adc_of_match[] = {
@@ -614,7 +612,7 @@ MODULE_DEVICE_TABLE(of, iproc_adc_of_match);
static struct platform_driver iproc_adc_driver = {
.probe = iproc_adc_probe,
- .remove = iproc_adc_remove,
+ .remove_new = iproc_adc_remove,
.driver = {
.name = "iproc-static-adc",
.of_match_table = iproc_adc_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* Re: [PATCH 06/49] iio: adc: bcm_iproc: Convert to platform remove callback returning void
2023-09-19 17:48 ` [PATCH 06/49] iio: adc: bcm_iproc: " Uwe Kleine-König
@ 2023-09-19 18:54 ` Florian Fainelli
0 siblings, 0 replies; 58+ messages in thread
From: Florian Fainelli @ 2023-09-19 18:54 UTC (permalink / raw)
To: Uwe Kleine-König, Jonathan Cameron
Cc: Lars-Peter Clausen, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Ruan Jinjie, linux-iio,
linux-arm-kernel, kernel
[-- Attachment #1: Type: text/plain, Size: 875 bytes --]
On 9/19/23 10:48, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]
^ permalink raw reply [flat|nested] 58+ messages in thread
* [PATCH 07/49] iio: adc: dln2: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (5 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 06/49] iio: adc: bcm_iproc: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 08/49] iio: adc: ep93xx: " Uwe Kleine-König
` (44 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/dln2-adc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c
index 97d162a3cba4..06cfbbabaf8d 100644
--- a/drivers/iio/adc/dln2-adc.c
+++ b/drivers/iio/adc/dln2-adc.c
@@ -691,19 +691,18 @@ static int dln2_adc_probe(struct platform_device *pdev)
return ret;
}
-static int dln2_adc_remove(struct platform_device *pdev)
+static void dln2_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
iio_device_unregister(indio_dev);
dln2_unregister_event_cb(pdev, DLN2_ADC_CONDITION_MET_EV);
- return 0;
}
static struct platform_driver dln2_adc_driver = {
.driver.name = DLN2_ADC_MOD_NAME,
.probe = dln2_adc_probe,
- .remove = dln2_adc_remove,
+ .remove_new = dln2_adc_remove,
};
module_platform_driver(dln2_adc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 08/49] iio: adc: ep93xx: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (6 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 07/49] iio: adc: dln2: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:54 ` Alexander Sverdlin
2023-09-19 17:48 ` [PATCH 09/49] iio: adc: exynos: " Uwe Kleine-König
` (43 subsequent siblings)
51 siblings, 1 reply; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Hartley Sweeten, Alexander Sverdlin, Lars-Peter Clausen,
linux-arm-kernel, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/ep93xx_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ep93xx_adc.c b/drivers/iio/adc/ep93xx_adc.c
index a35e6cead67d..971942ce4c66 100644
--- a/drivers/iio/adc/ep93xx_adc.c
+++ b/drivers/iio/adc/ep93xx_adc.c
@@ -217,15 +217,13 @@ static int ep93xx_adc_probe(struct platform_device *pdev)
return ret;
}
-static int ep93xx_adc_remove(struct platform_device *pdev)
+static void ep93xx_adc_remove(struct platform_device *pdev)
{
struct iio_dev *iiodev = platform_get_drvdata(pdev);
struct ep93xx_adc_priv *priv = iio_priv(iiodev);
iio_device_unregister(iiodev);
clk_disable_unprepare(priv->clk);
-
- return 0;
}
static const struct of_device_id ep93xx_adc_of_ids[] = {
@@ -240,7 +238,7 @@ static struct platform_driver ep93xx_adc_driver = {
.of_match_table = ep93xx_adc_of_ids,
},
.probe = ep93xx_adc_probe,
- .remove = ep93xx_adc_remove,
+ .remove_new = ep93xx_adc_remove,
};
module_platform_driver(ep93xx_adc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* Re: [PATCH 08/49] iio: adc: ep93xx: Convert to platform remove callback returning void
2023-09-19 17:48 ` [PATCH 08/49] iio: adc: ep93xx: " Uwe Kleine-König
@ 2023-09-19 17:54 ` Alexander Sverdlin
0 siblings, 0 replies; 58+ messages in thread
From: Alexander Sverdlin @ 2023-09-19 17:54 UTC (permalink / raw)
To: Uwe Kleine-König, Jonathan Cameron
Cc: Hartley Sweeten, Lars-Peter Clausen, linux-arm-kernel, linux-iio,
kernel
Hi Uwe,
On Tue, 2023-09-19 at 19:48 +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/iio/adc/ep93xx_adc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
--
Alexander Sverdlin.
^ permalink raw reply [flat|nested] 58+ messages in thread
* [PATCH 09/49] iio: adc: exynos: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (7 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 08/49] iio: adc: ep93xx: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 10/49] iio: adc: fsl-imx25-gcq: " Uwe Kleine-König
` (42 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Krzysztof Kozlowski, Alim Akhtar, linux-iio,
linux-arm-kernel, linux-samsung-soc, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/exynos_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index cff1ba57fb16..eb7a2dd59517 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -946,7 +946,7 @@ static int exynos_adc_probe(struct platform_device *pdev)
return ret;
}
-static int exynos_adc_remove(struct platform_device *pdev)
+static void exynos_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct exynos_adc *info = iio_priv(indio_dev);
@@ -964,8 +964,6 @@ static int exynos_adc_remove(struct platform_device *pdev)
exynos_adc_disable_clk(info);
exynos_adc_unprepare_clk(info);
regulator_disable(info->vdd);
-
- return 0;
}
static int exynos_adc_suspend(struct device *dev)
@@ -1006,7 +1004,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(exynos_adc_pm_ops, exynos_adc_suspend,
static struct platform_driver exynos_adc_driver = {
.probe = exynos_adc_probe,
- .remove = exynos_adc_remove,
+ .remove_new = exynos_adc_remove,
.driver = {
.name = "exynos-adc",
.of_match_table = exynos_adc_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 10/49] iio: adc: fsl-imx25-gcq: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (8 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 09/49] iio: adc: exynos: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 11/49] iio: adc: hx711: " Uwe Kleine-König
` (41 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Shawn Guo, Sascha Hauer, Fabio Estevam,
NXP Linux Team, linux-iio, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/fsl-imx25-gcq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c
index 551e83ae573c..68c813de0605 100644
--- a/drivers/iio/adc/fsl-imx25-gcq.c
+++ b/drivers/iio/adc/fsl-imx25-gcq.c
@@ -384,7 +384,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
return ret;
}
-static int mx25_gcq_remove(struct platform_device *pdev)
+static void mx25_gcq_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct mx25_gcq_priv *priv = iio_priv(indio_dev);
@@ -397,8 +397,6 @@ static int mx25_gcq_remove(struct platform_device *pdev)
if (priv->vref[i])
regulator_disable(priv->vref[i]);
}
-
- return 0;
}
static const struct of_device_id mx25_gcq_ids[] = {
@@ -413,7 +411,7 @@ static struct platform_driver mx25_gcq_driver = {
.of_match_table = mx25_gcq_ids,
},
.probe = mx25_gcq_probe,
- .remove = mx25_gcq_remove,
+ .remove_new = mx25_gcq_remove,
};
module_platform_driver(mx25_gcq_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 11/49] iio: adc: hx711: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (9 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 10/49] iio: adc: fsl-imx25-gcq: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 12/49] iio: adc: imx8qxp: " Uwe Kleine-König
` (40 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Andreas Klinger, Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/hx711.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/hx711.c b/drivers/iio/adc/hx711.c
index f7ee856a6b8b..c80c55fb8c6c 100644
--- a/drivers/iio/adc/hx711.c
+++ b/drivers/iio/adc/hx711.c
@@ -580,7 +580,7 @@ static int hx711_probe(struct platform_device *pdev)
return ret;
}
-static int hx711_remove(struct platform_device *pdev)
+static void hx711_remove(struct platform_device *pdev)
{
struct hx711_data *hx711_data;
struct iio_dev *indio_dev;
@@ -593,8 +593,6 @@ static int hx711_remove(struct platform_device *pdev)
iio_triggered_buffer_cleanup(indio_dev);
regulator_disable(hx711_data->reg_avdd);
-
- return 0;
}
static const struct of_device_id of_hx711_match[] = {
@@ -606,7 +604,7 @@ MODULE_DEVICE_TABLE(of, of_hx711_match);
static struct platform_driver hx711_driver = {
.probe = hx711_probe,
- .remove = hx711_remove,
+ .remove_new = hx711_remove,
.driver = {
.name = "hx711-gpio",
.of_match_table = of_hx711_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 12/49] iio: adc: imx8qxp: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (10 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 11/49] iio: adc: hx711: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 13/49] iio: adc: imx93: " Uwe Kleine-König
` (39 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Cai Huoqing, Haibo Chen, Lars-Peter Clausen, Shawn Guo,
Sascha Hauer, Fabio Estevam, NXP Linux Team, linux-iio,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/imx8qxp-adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c
index fff6e5a2d956..fe82198170d5 100644
--- a/drivers/iio/adc/imx8qxp-adc.c
+++ b/drivers/iio/adc/imx8qxp-adc.c
@@ -404,7 +404,7 @@ static int imx8qxp_adc_probe(struct platform_device *pdev)
return ret;
}
-static int imx8qxp_adc_remove(struct platform_device *pdev)
+static void imx8qxp_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct imx8qxp_adc *adc = iio_priv(indio_dev);
@@ -422,8 +422,6 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);
-
- return 0;
}
static int imx8qxp_adc_runtime_suspend(struct device *dev)
@@ -489,7 +487,7 @@ MODULE_DEVICE_TABLE(of, imx8qxp_adc_match);
static struct platform_driver imx8qxp_adc_driver = {
.probe = imx8qxp_adc_probe,
- .remove = imx8qxp_adc_remove,
+ .remove_new = imx8qxp_adc_remove,
.driver = {
.name = ADC_DRIVER_NAME,
.of_match_table = imx8qxp_adc_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 13/49] iio: adc: imx93: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (11 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 12/49] iio: adc: imx8qxp: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 14/49] iio: adc: meson_saradc: " Uwe Kleine-König
` (38 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Haibo Chen, Lars-Peter Clausen, Shawn Guo, Sascha Hauer,
Fabio Estevam, NXP Linux Team, linux-iio, linux-arm-kernel,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/imx93_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/imx93_adc.c b/drivers/iio/adc/imx93_adc.c
index dce9ec91e4a7..9bb1e4ba1aee 100644
--- a/drivers/iio/adc/imx93_adc.c
+++ b/drivers/iio/adc/imx93_adc.c
@@ -392,7 +392,7 @@ static int imx93_adc_probe(struct platform_device *pdev)
return ret;
}
-static int imx93_adc_remove(struct platform_device *pdev)
+static void imx93_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct imx93_adc *adc = iio_priv(indio_dev);
@@ -410,8 +410,6 @@ static int imx93_adc_remove(struct platform_device *pdev)
free_irq(adc->irq, adc);
clk_disable_unprepare(adc->ipg_clk);
regulator_disable(adc->vref);
-
- return 0;
}
static int imx93_adc_runtime_suspend(struct device *dev)
@@ -468,7 +466,7 @@ MODULE_DEVICE_TABLE(of, imx93_adc_match);
static struct platform_driver imx93_adc_driver = {
.probe = imx93_adc_probe,
- .remove = imx93_adc_remove,
+ .remove_new = imx93_adc_remove,
.driver = {
.name = IMX93_ADC_DRIVER_NAME,
.of_match_table = imx93_adc_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 14/49] iio: adc: meson_saradc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (12 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 13/49] iio: adc: imx93: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 15/49] iio: adc: mp2629: " Uwe Kleine-König
` (37 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, George Stark, Andy Shevchenko, Nuno Sá,
Rob Herring, linux-iio, 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 ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/meson_saradc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index 320e3e7e3d4d..a40986fb285c 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -1437,15 +1437,13 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
return ret;
}
-static int meson_sar_adc_remove(struct platform_device *pdev)
+static void meson_sar_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
iio_device_unregister(indio_dev);
meson_sar_adc_hw_disable(indio_dev);
-
- return 0;
}
static int meson_sar_adc_suspend(struct device *dev)
@@ -1480,7 +1478,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(meson_sar_adc_pm_ops,
static struct platform_driver meson_sar_adc_driver = {
.probe = meson_sar_adc_probe,
- .remove = meson_sar_adc_remove,
+ .remove_new = meson_sar_adc_remove,
.driver = {
.name = "meson-saradc",
.of_match_table = meson_sar_adc_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 15/49] iio: adc: mp2629: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (13 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 14/49] iio: adc: meson_saradc: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 16/49] iio: adc: mxs-lradc: " Uwe Kleine-König
` (36 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Saravanan Sekar, Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/mp2629_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/mp2629_adc.c b/drivers/iio/adc/mp2629_adc.c
index 88e947f300cf..7c66c2cd5be2 100644
--- a/drivers/iio/adc/mp2629_adc.c
+++ b/drivers/iio/adc/mp2629_adc.c
@@ -171,7 +171,7 @@ static int mp2629_adc_probe(struct platform_device *pdev)
return ret;
}
-static int mp2629_adc_remove(struct platform_device *pdev)
+static void mp2629_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct mp2629_adc *info = iio_priv(indio_dev);
@@ -184,8 +184,6 @@ static int mp2629_adc_remove(struct platform_device *pdev)
MP2629_ADC_CONTINUOUS, 0);
regmap_update_bits(info->regmap, MP2629_REG_ADC_CTRL,
MP2629_ADC_START, 0);
-
- return 0;
}
static const struct of_device_id mp2629_adc_of_match[] = {
@@ -200,7 +198,7 @@ static struct platform_driver mp2629_adc_driver = {
.of_match_table = mp2629_adc_of_match,
},
.probe = mp2629_adc_probe,
- .remove = mp2629_adc_remove,
+ .remove_new = mp2629_adc_remove,
};
module_platform_driver(mp2629_adc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 16/49] iio: adc: mxs-lradc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (14 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 15/49] iio: adc: mp2629: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:48 ` [PATCH 17/49] iio: adc: npcm: " Uwe Kleine-König
` (35 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Shawn Guo, Sascha Hauer, Fabio Estevam,
NXP Linux Team, Jiakai Luo, Dongliang Mu, linux-iio,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/mxs-lradc-adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
index a50f39143d3e..2e60c10ee4ff 100644
--- a/drivers/iio/adc/mxs-lradc-adc.c
+++ b/drivers/iio/adc/mxs-lradc-adc.c
@@ -807,7 +807,7 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
return ret;
}
-static int mxs_lradc_adc_remove(struct platform_device *pdev)
+static void mxs_lradc_adc_remove(struct platform_device *pdev)
{
struct iio_dev *iio = platform_get_drvdata(pdev);
struct mxs_lradc_adc *adc = iio_priv(iio);
@@ -816,8 +816,6 @@ static int mxs_lradc_adc_remove(struct platform_device *pdev)
mxs_lradc_adc_hw_stop(adc);
iio_triggered_buffer_cleanup(iio);
mxs_lradc_adc_trigger_remove(iio);
-
- return 0;
}
static struct platform_driver mxs_lradc_adc_driver = {
@@ -825,7 +823,7 @@ static struct platform_driver mxs_lradc_adc_driver = {
.name = "mxs-lradc-adc",
},
.probe = mxs_lradc_adc_probe,
- .remove = mxs_lradc_adc_remove,
+ .remove_new = mxs_lradc_adc_remove,
};
module_platform_driver(mxs_lradc_adc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 17/49] iio: adc: npcm: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (15 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 16/49] iio: adc: mxs-lradc: " Uwe Kleine-König
@ 2023-09-19 17:48 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 18/49] iio: adc: qcom-pm8xxx-xoadc: " Uwe Kleine-König
` (34 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:48 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
Nancy Yuen, Benjamin Fair, Lars-Peter Clausen, openbmc, linux-iio,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/npcm_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/npcm_adc.c b/drivers/iio/adc/npcm_adc.c
index 3d9207c160eb..3a55465951e7 100644
--- a/drivers/iio/adc/npcm_adc.c
+++ b/drivers/iio/adc/npcm_adc.c
@@ -320,7 +320,7 @@ static int npcm_adc_probe(struct platform_device *pdev)
return ret;
}
-static int npcm_adc_remove(struct platform_device *pdev)
+static void npcm_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct npcm_adc *info = iio_priv(indio_dev);
@@ -333,13 +333,11 @@ static int npcm_adc_remove(struct platform_device *pdev)
if (!IS_ERR(info->vref))
regulator_disable(info->vref);
clk_disable_unprepare(info->adc_clk);
-
- return 0;
}
static struct platform_driver npcm_adc_driver = {
.probe = npcm_adc_probe,
- .remove = npcm_adc_remove,
+ .remove_new = npcm_adc_remove,
.driver = {
.name = "npcm_adc",
.of_match_table = npcm_adc_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 18/49] iio: adc: qcom-pm8xxx-xoadc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (16 preceding siblings ...)
2023-09-19 17:48 ` [PATCH 17/49] iio: adc: npcm: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 21:14 ` Konrad Dybcio
2023-09-19 17:49 ` [PATCH 19/49] iio: adc: rcar-gyroadc: " Uwe Kleine-König
` (33 subsequent siblings)
51 siblings, 1 reply; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, Lars-Peter Clausen,
linux-arm-msm, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/qcom-pm8xxx-xoadc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
index 64a3aeb6261c..01c5586df56d 100644
--- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c
+++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c
@@ -957,7 +957,7 @@ static int pm8xxx_xoadc_probe(struct platform_device *pdev)
return ret;
}
-static int pm8xxx_xoadc_remove(struct platform_device *pdev)
+static void pm8xxx_xoadc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct pm8xxx_xoadc *adc = iio_priv(indio_dev);
@@ -965,8 +965,6 @@ static int pm8xxx_xoadc_remove(struct platform_device *pdev)
iio_device_unregister(indio_dev);
regulator_disable(adc->vref);
-
- return 0;
}
static const struct xoadc_variant pm8018_variant = {
@@ -1019,7 +1017,7 @@ static struct platform_driver pm8xxx_xoadc_driver = {
.of_match_table = pm8xxx_xoadc_id_table,
},
.probe = pm8xxx_xoadc_probe,
- .remove = pm8xxx_xoadc_remove,
+ .remove_new = pm8xxx_xoadc_remove,
};
module_platform_driver(pm8xxx_xoadc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* Re: [PATCH 18/49] iio: adc: qcom-pm8xxx-xoadc: Convert to platform remove callback returning void
2023-09-19 17:49 ` [PATCH 18/49] iio: adc: qcom-pm8xxx-xoadc: " Uwe Kleine-König
@ 2023-09-19 21:14 ` Konrad Dybcio
0 siblings, 0 replies; 58+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:14 UTC (permalink / raw)
To: Uwe Kleine-König, Jonathan Cameron
Cc: Andy Gross, Bjorn Andersson, Lars-Peter Clausen, linux-arm-msm,
linux-iio, kernel
On 9/19/23 19:49, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 58+ messages in thread
* [PATCH 19/49] iio: adc: rcar-gyroadc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (17 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 18/49] iio: adc: qcom-pm8xxx-xoadc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 20/49] iio: adc: stm32-adc-core: " Uwe Kleine-König
` (32 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Marek Vasut, Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/rcar-gyroadc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
index b8972f673c9d..d524f2e8e927 100644
--- a/drivers/iio/adc/rcar-gyroadc.c
+++ b/drivers/iio/adc/rcar-gyroadc.c
@@ -559,7 +559,7 @@ static int rcar_gyroadc_probe(struct platform_device *pdev)
return ret;
}
-static int rcar_gyroadc_remove(struct platform_device *pdev)
+static void rcar_gyroadc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct rcar_gyroadc *priv = iio_priv(indio_dev);
@@ -573,8 +573,6 @@ static int rcar_gyroadc_remove(struct platform_device *pdev)
pm_runtime_set_suspended(dev);
clk_disable_unprepare(priv->clk);
rcar_gyroadc_deinit_supplies(indio_dev);
-
- return 0;
}
static int rcar_gyroadc_suspend(struct device *dev)
@@ -603,7 +601,7 @@ static const struct dev_pm_ops rcar_gyroadc_pm_ops = {
static struct platform_driver rcar_gyroadc_driver = {
.probe = rcar_gyroadc_probe,
- .remove = rcar_gyroadc_remove,
+ .remove_new = rcar_gyroadc_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = rcar_gyroadc_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 20/49] iio: adc: stm32-adc-core: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (18 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 19/49] iio: adc: rcar-gyroadc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 21/49] iio: adc: stm32-adc: " Uwe Kleine-König
` (31 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
Olivier Moysan, Fabrice Gasnier, Rob Herring, Heiko Stuebner,
Zhang Shurong, Yangtao Li, linux-iio, linux-stm32,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/stm32-adc-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index bbd5bdd732f0..c19506b0aac8 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -819,7 +819,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_adc_remove(struct platform_device *pdev)
+static void stm32_adc_remove(struct platform_device *pdev)
{
struct stm32_adc_common *common = platform_get_drvdata(pdev);
struct stm32_adc_priv *priv = to_stm32_adc_priv(common);
@@ -831,8 +831,6 @@ static int stm32_adc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
-
- return 0;
}
static int stm32_adc_core_runtime_suspend(struct device *dev)
@@ -913,7 +911,7 @@ MODULE_DEVICE_TABLE(of, stm32_adc_of_match);
static struct platform_driver stm32_adc_driver = {
.probe = stm32_adc_probe,
- .remove = stm32_adc_remove,
+ .remove_new = stm32_adc_remove,
.driver = {
.name = "stm32-adc-core",
.of_match_table = stm32_adc_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 21/49] iio: adc: stm32-adc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (19 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 20/49] iio: adc: stm32-adc-core: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 22/49] iio: adc: stm32-dfsdm-adc: " Uwe Kleine-König
` (30 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
Fabrice Gasnier, Olivier Moysan, Sean Nyekjaer, Andy Shevchenko,
Tom Rix, linux-iio, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/stm32-adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index f7613efb870d..25a912805439 100644
--- a/drivers/iio/adc/stm32-adc.c
+++ b/drivers/iio/adc/stm32-adc.c
@@ -2513,7 +2513,7 @@ static int stm32_adc_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_adc_remove(struct platform_device *pdev)
+static void stm32_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct stm32_adc *adc = iio_priv(indio_dev);
@@ -2532,8 +2532,6 @@ static int stm32_adc_remove(struct platform_device *pdev)
adc->rx_buf, adc->rx_dma_buf);
dma_release_channel(adc->dma_chan);
}
-
- return 0;
}
static int stm32_adc_suspend(struct device *dev)
@@ -2659,7 +2657,7 @@ MODULE_DEVICE_TABLE(of, stm32_adc_of_match);
static struct platform_driver stm32_adc_driver = {
.probe = stm32_adc_probe,
- .remove = stm32_adc_remove,
+ .remove_new = stm32_adc_remove,
.driver = {
.name = "stm32-adc",
.of_match_table = stm32_adc_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 22/49] iio: adc: stm32-dfsdm-adc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (20 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 21/49] iio: adc: stm32-adc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 23/49] iio: adc: stm32-dfsdm-core: " Uwe Kleine-König
` (29 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
Rob Herring, Heiko Stuebner, Olivier Moysan, linux-iio,
linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/stm32-dfsdm-adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index b5cc43d12b6f..ca08ae3108b2 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -1620,7 +1620,7 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_dfsdm_adc_remove(struct platform_device *pdev)
+static void stm32_dfsdm_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct stm32_dfsdm_adc *adc = iio_priv(indio_dev);
@@ -1629,8 +1629,6 @@ static int stm32_dfsdm_adc_remove(struct platform_device *pdev)
of_platform_depopulate(&pdev->dev);
iio_device_unregister(indio_dev);
stm32_dfsdm_dma_release(indio_dev);
-
- return 0;
}
static int stm32_dfsdm_adc_suspend(struct device *dev)
@@ -1677,7 +1675,7 @@ static struct platform_driver stm32_dfsdm_adc_driver = {
.pm = pm_sleep_ptr(&stm32_dfsdm_adc_pm_ops),
},
.probe = stm32_dfsdm_adc_probe,
- .remove = stm32_dfsdm_adc_remove,
+ .remove_new = stm32_dfsdm_adc_remove,
};
module_platform_driver(stm32_dfsdm_adc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 23/49] iio: adc: stm32-dfsdm-core: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (21 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 22/49] iio: adc: stm32-dfsdm-adc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 24/49] iio: adc: sun4i-gpadc-iio: " Uwe Kleine-König
` (28 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
Rob Herring, Olivier Moysan, Heiko Stuebner, linux-iio,
linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/stm32-dfsdm-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index 0f6ebb3061a0..a05d978b8cb8 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -436,7 +436,7 @@ static int stm32_dfsdm_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_dfsdm_core_remove(struct platform_device *pdev)
+static void stm32_dfsdm_core_remove(struct platform_device *pdev)
{
struct stm32_dfsdm *dfsdm = platform_get_drvdata(pdev);
@@ -446,8 +446,6 @@ static int stm32_dfsdm_core_remove(struct platform_device *pdev)
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
stm32_dfsdm_clk_disable_unprepare(dfsdm);
-
- return 0;
}
static int stm32_dfsdm_core_suspend(struct device *dev)
@@ -508,7 +506,7 @@ static const struct dev_pm_ops stm32_dfsdm_core_pm_ops = {
static struct platform_driver stm32_dfsdm_driver = {
.probe = stm32_dfsdm_probe,
- .remove = stm32_dfsdm_core_remove,
+ .remove_new = stm32_dfsdm_core_remove,
.driver = {
.name = "stm32-dfsdm",
.of_match_table = stm32_dfsdm_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 24/49] iio: adc: sun4i-gpadc-iio: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (22 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 23/49] iio: adc: stm32-dfsdm-core: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:58 ` Jernej Škrabec
2023-09-19 17:49 ` [PATCH 25/49] iio: adc: ti_am335x_adc: " Uwe Kleine-König
` (27 subsequent siblings)
51 siblings, 1 reply; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Rafael J. Wysocki, Damien Le Moal, Mark Brown, Ido Schimmel,
Heiko Stuebner, Daniel Lezcano, Rob Herring, linux-iio,
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 ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/sun4i-gpadc-iio.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
index 25bba96367a8..100ecced5fc1 100644
--- a/drivers/iio/adc/sun4i-gpadc-iio.c
+++ b/drivers/iio/adc/sun4i-gpadc-iio.c
@@ -669,7 +669,7 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
return ret;
}
-static int sun4i_gpadc_remove(struct platform_device *pdev)
+static void sun4i_gpadc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
@@ -678,12 +678,10 @@ static int sun4i_gpadc_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
if (!IS_ENABLED(CONFIG_THERMAL_OF))
- return 0;
+ return;
if (!info->no_irq)
iio_map_array_unregister(indio_dev);
-
- return 0;
}
static const struct platform_device_id sun4i_gpadc_id[] = {
@@ -702,7 +700,7 @@ static struct platform_driver sun4i_gpadc_driver = {
},
.id_table = sun4i_gpadc_id,
.probe = sun4i_gpadc_probe,
- .remove = sun4i_gpadc_remove,
+ .remove_new = sun4i_gpadc_remove,
};
MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_id);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* Re: [PATCH 24/49] iio: adc: sun4i-gpadc-iio: Convert to platform remove callback returning void
2023-09-19 17:49 ` [PATCH 24/49] iio: adc: sun4i-gpadc-iio: " Uwe Kleine-König
@ 2023-09-19 17:58 ` Jernej Škrabec
0 siblings, 0 replies; 58+ messages in thread
From: Jernej Škrabec @ 2023-09-19 17:58 UTC (permalink / raw)
To: Jonathan Cameron, Uwe Kleine-König
Cc: Lars-Peter Clausen, Chen-Yu Tsai, Samuel Holland,
Rafael J. Wysocki, Damien Le Moal, Mark Brown, Ido Schimmel,
Heiko Stuebner, Daniel Lezcano, Rob Herring, linux-iio,
linux-arm-kernel, linux-sunxi, kernel
Dne torek, 19. september 2023 ob 19:49:06 CEST 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 ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/iio/adc/sun4i-gpadc-iio.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c
> b/drivers/iio/adc/sun4i-gpadc-iio.c index 25bba96367a8..100ecced5fc1 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -669,7 +669,7 @@ static int sun4i_gpadc_probe(struct platform_device
> *pdev) return ret;
> }
>
> -static int sun4i_gpadc_remove(struct platform_device *pdev)
> +static void sun4i_gpadc_remove(struct platform_device *pdev)
> {
> struct iio_dev *indio_dev = platform_get_drvdata(pdev);
> struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
> @@ -678,12 +678,10 @@ static int sun4i_gpadc_remove(struct platform_device
> *pdev) pm_runtime_disable(&pdev->dev);
>
> if (!IS_ENABLED(CONFIG_THERMAL_OF))
> - return 0;
> + return;
>
> if (!info->no_irq)
> iio_map_array_unregister(indio_dev);
> -
> - return 0;
> }
>
> static const struct platform_device_id sun4i_gpadc_id[] = {
> @@ -702,7 +700,7 @@ static struct platform_driver sun4i_gpadc_driver = {
> },
> .id_table = sun4i_gpadc_id,
> .probe = sun4i_gpadc_probe,
> - .remove = sun4i_gpadc_remove,
> + .remove_new = sun4i_gpadc_remove,
> };
> MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_id);
^ permalink raw reply [flat|nested] 58+ messages in thread
* [PATCH 25/49] iio: adc: ti_am335x_adc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (23 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 24/49] iio: adc: sun4i-gpadc-iio: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 26/49] iio: adc: twl4030-madc: " Uwe Kleine-König
` (26 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Heiko Stuebner, Rob Herring, linux-iio,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/ti_am335x_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 8db7a01cb5fb..c755e8cd5220 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -681,7 +681,7 @@ static int tiadc_probe(struct platform_device *pdev)
return err;
}
-static int tiadc_remove(struct platform_device *pdev)
+static void tiadc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct tiadc_device *adc_dev = iio_priv(indio_dev);
@@ -697,8 +697,6 @@ static int tiadc_remove(struct platform_device *pdev)
step_en = get_adc_step_mask(adc_dev);
am335x_tsc_se_clr(adc_dev->mfd_tscadc, step_en);
-
- return 0;
}
static int tiadc_suspend(struct device *dev)
@@ -747,7 +745,7 @@ static struct platform_driver tiadc_driver = {
.of_match_table = ti_adc_dt_ids,
},
.probe = tiadc_probe,
- .remove = tiadc_remove,
+ .remove_new = tiadc_remove,
};
module_platform_driver(tiadc_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 26/49] iio: adc: twl4030-madc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (24 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 25/49] iio: adc: ti_am335x_adc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 27/49] iio: adc: twl6030-gpadc: " Uwe Kleine-König
` (25 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Dmitry Torokhov, Andy Shevchenko, linux-iio,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/twl4030-madc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/twl4030-madc.c b/drivers/iio/adc/twl4030-madc.c
index c279c4f2c9b7..4a247ca25a44 100644
--- a/drivers/iio/adc/twl4030-madc.c
+++ b/drivers/iio/adc/twl4030-madc.c
@@ -892,7 +892,7 @@ static int twl4030_madc_probe(struct platform_device *pdev)
return ret;
}
-static int twl4030_madc_remove(struct platform_device *pdev)
+static void twl4030_madc_remove(struct platform_device *pdev)
{
struct iio_dev *iio_dev = platform_get_drvdata(pdev);
struct twl4030_madc_data *madc = iio_priv(iio_dev);
@@ -903,8 +903,6 @@ static int twl4030_madc_remove(struct platform_device *pdev)
twl4030_madc_set_power(madc, 0);
regulator_disable(madc->usb3v1);
-
- return 0;
}
#ifdef CONFIG_OF
@@ -917,7 +915,7 @@ MODULE_DEVICE_TABLE(of, twl_madc_of_match);
static struct platform_driver twl4030_madc_driver = {
.probe = twl4030_madc_probe,
- .remove = twl4030_madc_remove,
+ .remove_new = twl4030_madc_remove,
.driver = {
.name = "twl4030_madc",
.of_match_table = of_match_ptr(twl_madc_of_match),
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 27/49] iio: adc: twl6030-gpadc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (25 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 26/49] iio: adc: twl4030-madc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 28/49] iio: adc: vf610_adc: " Uwe Kleine-König
` (24 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Lars-Peter Clausen, Andreas Kemnade, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/twl6030-gpadc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/twl6030-gpadc.c b/drivers/iio/adc/twl6030-gpadc.c
index 32873fb5f367..224e9cb5e147 100644
--- a/drivers/iio/adc/twl6030-gpadc.c
+++ b/drivers/iio/adc/twl6030-gpadc.c
@@ -968,14 +968,12 @@ static int twl6030_gpadc_probe(struct platform_device *pdev)
return iio_device_register(indio_dev);
}
-static int twl6030_gpadc_remove(struct platform_device *pdev)
+static void twl6030_gpadc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
twl6030_gpadc_disable_irq(TWL6030_GPADC_RT_SW1_EOC_MASK);
iio_device_unregister(indio_dev);
-
- return 0;
}
static int twl6030_gpadc_suspend(struct device *pdev)
@@ -1007,7 +1005,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(twl6030_gpadc_pm_ops, twl6030_gpadc_suspend,
static struct platform_driver twl6030_gpadc_driver = {
.probe = twl6030_gpadc_probe,
- .remove = twl6030_gpadc_remove,
+ .remove_new = twl6030_gpadc_remove,
.driver = {
.name = DRIVER_NAME,
.pm = pm_sleep_ptr(&twl6030_gpadc_pm_ops),
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 28/49] iio: adc: vf610_adc: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (26 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 27/49] iio: adc: twl6030-gpadc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 29/49] iio: dac: dpot-dac: " Uwe Kleine-König
` (23 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Haibo Chen, Lars-Peter Clausen, linux-iio, linux-imx, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/adc/vf610_adc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index ae31aafd2653..e4548df3f8fb 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -916,7 +916,7 @@ static int vf610_adc_probe(struct platform_device *pdev)
return ret;
}
-static int vf610_adc_remove(struct platform_device *pdev)
+static void vf610_adc_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct vf610_adc *info = iio_priv(indio_dev);
@@ -925,8 +925,6 @@ static int vf610_adc_remove(struct platform_device *pdev)
iio_triggered_buffer_cleanup(indio_dev);
regulator_disable(info->vref);
clk_disable_unprepare(info->clk);
-
- return 0;
}
static int vf610_adc_suspend(struct device *dev)
@@ -974,7 +972,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(vf610_adc_pm_ops, vf610_adc_suspend,
static struct platform_driver vf610_adc_driver = {
.probe = vf610_adc_probe,
- .remove = vf610_adc_remove,
+ .remove_new = vf610_adc_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = vf610_adc_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 29/49] iio: dac: dpot-dac: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (27 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 28/49] iio: adc: vf610_adc: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 30/49] iio: dac: lpc18xx_dac: " Uwe Kleine-König
` (22 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Peter Rosin, Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/dac/dpot-dac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/dac/dpot-dac.c b/drivers/iio/dac/dpot-dac.c
index 83ce9489259c..7332064d0852 100644
--- a/drivers/iio/dac/dpot-dac.c
+++ b/drivers/iio/dac/dpot-dac.c
@@ -226,15 +226,13 @@ static int dpot_dac_probe(struct platform_device *pdev)
return ret;
}
-static int dpot_dac_remove(struct platform_device *pdev)
+static void dpot_dac_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct dpot_dac *dac = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
regulator_disable(dac->vref);
-
- return 0;
}
static const struct of_device_id dpot_dac_match[] = {
@@ -245,7 +243,7 @@ MODULE_DEVICE_TABLE(of, dpot_dac_match);
static struct platform_driver dpot_dac_driver = {
.probe = dpot_dac_probe,
- .remove = dpot_dac_remove,
+ .remove_new = dpot_dac_remove,
.driver = {
.name = "iio-dpot-dac",
.of_match_table = dpot_dac_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 30/49] iio: dac: lpc18xx_dac: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (28 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 29/49] iio: dac: dpot-dac: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 31/49] iio: dac: stm32-dac-core: " Uwe Kleine-König
` (21 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Vladimir Zapolskiy, linux-iio,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/dac/lpc18xx_dac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/dac/lpc18xx_dac.c b/drivers/iio/dac/lpc18xx_dac.c
index 60467c6f2c6e..b3aa4443a6a4 100644
--- a/drivers/iio/dac/lpc18xx_dac.c
+++ b/drivers/iio/dac/lpc18xx_dac.c
@@ -165,7 +165,7 @@ static int lpc18xx_dac_probe(struct platform_device *pdev)
return ret;
}
-static int lpc18xx_dac_remove(struct platform_device *pdev)
+static void lpc18xx_dac_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct lpc18xx_dac *dac = iio_priv(indio_dev);
@@ -175,8 +175,6 @@ static int lpc18xx_dac_remove(struct platform_device *pdev)
writel(0, dac->base + LPC18XX_DAC_CTRL);
clk_disable_unprepare(dac->clk);
regulator_disable(dac->vref);
-
- return 0;
}
static const struct of_device_id lpc18xx_dac_match[] = {
@@ -187,7 +185,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dac_match);
static struct platform_driver lpc18xx_dac_driver = {
.probe = lpc18xx_dac_probe,
- .remove = lpc18xx_dac_remove,
+ .remove_new = lpc18xx_dac_remove,
.driver = {
.name = "lpc18xx-dac",
.of_match_table = lpc18xx_dac_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 31/49] iio: dac: stm32-dac-core: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (29 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 30/49] iio: dac: lpc18xx_dac: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 32/49] iio: dac: stm32-dac: " Uwe Kleine-König
` (20 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue, linux-iio,
linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/dac/stm32-dac-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c
index 83bf184e3adc..15abe048729e 100644
--- a/drivers/iio/dac/stm32-dac-core.c
+++ b/drivers/iio/dac/stm32-dac-core.c
@@ -183,7 +183,7 @@ static int stm32_dac_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_dac_remove(struct platform_device *pdev)
+static void stm32_dac_remove(struct platform_device *pdev)
{
pm_runtime_get_sync(&pdev->dev);
of_platform_depopulate(&pdev->dev);
@@ -191,8 +191,6 @@ static int stm32_dac_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
-
- return 0;
}
static int stm32_dac_core_resume(struct device *dev)
@@ -249,7 +247,7 @@ MODULE_DEVICE_TABLE(of, stm32_dac_of_match);
static struct platform_driver stm32_dac_driver = {
.probe = stm32_dac_probe,
- .remove = stm32_dac_remove,
+ .remove_new = stm32_dac_remove,
.driver = {
.name = "stm32-dac-core",
.of_match_table = stm32_dac_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 32/49] iio: dac: stm32-dac: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (30 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 31/49] iio: dac: stm32-dac-core: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 33/49] iio: dac: vf610: " Uwe Kleine-König
` (19 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
Andy Shevchenko, linux-iio, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/dac/stm32-dac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c
index 3cab28c7ee3b..5a722f307e7e 100644
--- a/drivers/iio/dac/stm32-dac.c
+++ b/drivers/iio/dac/stm32-dac.c
@@ -362,7 +362,7 @@ static int stm32_dac_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_dac_remove(struct platform_device *pdev)
+static void stm32_dac_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -371,8 +371,6 @@ static int stm32_dac_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
-
- return 0;
}
static int stm32_dac_suspend(struct device *dev)
@@ -400,7 +398,7 @@ MODULE_DEVICE_TABLE(of, stm32_dac_of_match);
static struct platform_driver stm32_dac_driver = {
.probe = stm32_dac_probe,
- .remove = stm32_dac_remove,
+ .remove_new = stm32_dac_remove,
.driver = {
.name = "stm32-dac",
.of_match_table = stm32_dac_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 33/49] iio: dac: vf610: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (31 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 32/49] iio: dac: stm32-dac: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 34/49] iio: gyro: hid-sensor-gyro-3d: " Uwe Kleine-König
` (18 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/dac/vf610_dac.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/dac/vf610_dac.c b/drivers/iio/dac/vf610_dac.c
index fc182250c622..de73bc5a1c93 100644
--- a/drivers/iio/dac/vf610_dac.c
+++ b/drivers/iio/dac/vf610_dac.c
@@ -231,7 +231,7 @@ static int vf610_dac_probe(struct platform_device *pdev)
return ret;
}
-static int vf610_dac_remove(struct platform_device *pdev)
+static void vf610_dac_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct vf610_dac *info = iio_priv(indio_dev);
@@ -239,8 +239,6 @@ static int vf610_dac_remove(struct platform_device *pdev)
iio_device_unregister(indio_dev);
vf610_dac_exit(info);
clk_disable_unprepare(info->clk);
-
- return 0;
}
static int vf610_dac_suspend(struct device *dev)
@@ -274,7 +272,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(vf610_dac_pm_ops, vf610_dac_suspend,
static struct platform_driver vf610_dac_driver = {
.probe = vf610_dac_probe,
- .remove = vf610_dac_remove,
+ .remove_new = vf610_dac_remove,
.driver = {
.name = "vf610-dac",
.of_match_table = vf610_dac_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 34/49] iio: gyro: hid-sensor-gyro-3d: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (32 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 33/49] iio: dac: vf610: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 35/49] iio: humidity: hid-sensor-humidity: " Uwe Kleine-König
` (17 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/gyro/hid-sensor-gyro-3d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 698c50da1f10..59a38bf9459b 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -359,7 +359,7 @@ static int hid_gyro_3d_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_gyro_3d_remove(struct platform_device *pdev)
+static void hid_gyro_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -368,8 +368,6 @@ static int hid_gyro_3d_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_GYRO_3D);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &gyro_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_gyro_3d_ids[] = {
@@ -388,7 +386,7 @@ static struct platform_driver hid_gyro_3d_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_gyro_3d_probe,
- .remove = hid_gyro_3d_remove,
+ .remove_new = hid_gyro_3d_remove,
};
module_platform_driver(hid_gyro_3d_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 35/49] iio: humidity: hid-sensor-humidity: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (33 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 34/49] iio: gyro: hid-sensor-gyro-3d: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 36/49] iio: light: cm3605: " Uwe Kleine-König
` (16 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/humidity/hid-sensor-humidity.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humidity/hid-sensor-humidity.c
index fa0fe404a70a..bf6d2636a85e 100644
--- a/drivers/iio/humidity/hid-sensor-humidity.c
+++ b/drivers/iio/humidity/hid-sensor-humidity.c
@@ -260,7 +260,7 @@ static int hid_humidity_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_humidity_remove(struct platform_device *pdev)
+static void hid_humidity_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -269,8 +269,6 @@ static int hid_humidity_remove(struct platform_device *pdev)
iio_device_unregister(indio_dev);
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY);
hid_sensor_remove_trigger(indio_dev, &humid_st->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_humidity_ids[] = {
@@ -289,7 +287,7 @@ static struct platform_driver hid_humidity_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_humidity_probe,
- .remove = hid_humidity_remove,
+ .remove_new = hid_humidity_remove,
};
module_platform_driver(hid_humidity_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 36/49] iio: light: cm3605: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (34 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 35/49] iio: humidity: hid-sensor-humidity: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 37/49] iio: light: hid-sensor-als: " Uwe Kleine-König
` (15 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Kevin Tsai, Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/light/cm3605.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c
index e7f0b81b7f5a..22a63a89f289 100644
--- a/drivers/iio/light/cm3605.c
+++ b/drivers/iio/light/cm3605.c
@@ -266,7 +266,7 @@ static int cm3605_probe(struct platform_device *pdev)
return ret;
}
-static int cm3605_remove(struct platform_device *pdev)
+static void cm3605_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct cm3605 *cm3605 = iio_priv(indio_dev);
@@ -276,8 +276,6 @@ static int cm3605_remove(struct platform_device *pdev)
gpiod_set_value_cansleep(cm3605->aset, 0);
iio_device_unregister(indio_dev);
regulator_disable(cm3605->vdd);
-
- return 0;
}
static int cm3605_pm_suspend(struct device *dev)
@@ -320,7 +318,7 @@ static struct platform_driver cm3605_driver = {
.pm = pm_sleep_ptr(&cm3605_dev_pm_ops),
},
.probe = cm3605_probe,
- .remove = cm3605_remove,
+ .remove_new = cm3605_remove,
};
module_platform_driver(cm3605_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 37/49] iio: light: hid-sensor-als: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (35 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 36/49] iio: light: cm3605: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 38/49] iio: light: hid-sensor-prox: " Uwe Kleine-König
` (14 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/light/hid-sensor-als.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index eb1aedad7edc..cb76841ec0ce 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -347,7 +347,7 @@ static int hid_als_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_als_remove(struct platform_device *pdev)
+static void hid_als_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -356,8 +356,6 @@ static int hid_als_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, hsdev->usage);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &als_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_als_ids[] = {
@@ -380,7 +378,7 @@ static struct platform_driver hid_als_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_als_probe,
- .remove = hid_als_remove,
+ .remove_new = hid_als_remove,
};
module_platform_driver(hid_als_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 38/49] iio: light: hid-sensor-prox: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (36 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 37/49] iio: light: hid-sensor-als: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 39/49] iio: light: lm3533-als: " Uwe Kleine-König
` (13 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/light/hid-sensor-prox.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
index a47591e1bad9..26c481d2998c 100644
--- a/drivers/iio/light/hid-sensor-prox.c
+++ b/drivers/iio/light/hid-sensor-prox.c
@@ -313,7 +313,7 @@ static int hid_prox_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_prox_remove(struct platform_device *pdev)
+static void hid_prox_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -322,8 +322,6 @@ static int hid_prox_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, hsdev->usage);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &prox_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_prox_ids[] = {
@@ -346,7 +344,7 @@ static struct platform_driver hid_prox_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_prox_probe,
- .remove = hid_prox_remove,
+ .remove_new = hid_prox_remove,
};
module_platform_driver(hid_prox_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 39/49] iio: light: lm3533-als: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (37 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 38/49] iio: light: hid-sensor-prox: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 40/49] iio: magnetometer: hid-sensor-magn-3d: " Uwe Kleine-König
` (12 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/light/lm3533-als.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c
index 827bc25269e9..7800f7fa51b7 100644
--- a/drivers/iio/light/lm3533-als.c
+++ b/drivers/iio/light/lm3533-als.c
@@ -895,7 +895,7 @@ static int lm3533_als_probe(struct platform_device *pdev)
return ret;
}
-static int lm3533_als_remove(struct platform_device *pdev)
+static void lm3533_als_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct lm3533_als *als = iio_priv(indio_dev);
@@ -905,8 +905,6 @@ static int lm3533_als_remove(struct platform_device *pdev)
lm3533_als_disable(als);
if (als->irq)
free_irq(als->irq, indio_dev);
-
- return 0;
}
static struct platform_driver lm3533_als_driver = {
@@ -914,7 +912,7 @@ static struct platform_driver lm3533_als_driver = {
.name = "lm3533-als",
},
.probe = lm3533_als_probe,
- .remove = lm3533_als_remove,
+ .remove_new = lm3533_als_remove,
};
module_platform_driver(lm3533_als_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 40/49] iio: magnetometer: hid-sensor-magn-3d: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (38 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 39/49] iio: light: lm3533-als: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 41/49] iio: orientation: hid-sensor-incl-3d: " Uwe Kleine-König
` (11 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/magnetometer/hid-sensor-magn-3d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index e85a3a8eea90..5c795a430d09 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -547,7 +547,7 @@ static int hid_magn_3d_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_magn_3d_remove(struct platform_device *pdev)
+static void hid_magn_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -556,8 +556,6 @@ static int hid_magn_3d_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &magn_state->magn_flux_attributes);
-
- return 0;
}
static const struct platform_device_id hid_magn_3d_ids[] = {
@@ -576,7 +574,7 @@ static struct platform_driver hid_magn_3d_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_magn_3d_probe,
- .remove = hid_magn_3d_remove,
+ .remove_new = hid_magn_3d_remove,
};
module_platform_driver(hid_magn_3d_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 41/49] iio: orientation: hid-sensor-incl-3d: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (39 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 40/49] iio: magnetometer: hid-sensor-magn-3d: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 42/49] iio: orientation: hid-sensor-rotation: " Uwe Kleine-König
` (10 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/orientation/hid-sensor-incl-3d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c
index ba5b581d5b25..8943d5c78bc0 100644
--- a/drivers/iio/orientation/hid-sensor-incl-3d.c
+++ b/drivers/iio/orientation/hid-sensor-incl-3d.c
@@ -383,7 +383,7 @@ static int hid_incl_3d_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_incl_3d_remove(struct platform_device *pdev)
+static void hid_incl_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -392,8 +392,6 @@ static int hid_incl_3d_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_INCLINOMETER_3D);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &incl_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_incl_3d_ids[] = {
@@ -412,7 +410,7 @@ static struct platform_driver hid_incl_3d_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_incl_3d_probe,
- .remove = hid_incl_3d_remove,
+ .remove_new = hid_incl_3d_remove,
};
module_platform_driver(hid_incl_3d_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 42/49] iio: orientation: hid-sensor-rotation: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (40 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 41/49] iio: orientation: hid-sensor-incl-3d: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 43/49] iio: position: hid-sensor-custom-intel-hinge: " Uwe Kleine-König
` (9 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/orientation/hid-sensor-rotation.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
index a033699910e8..5e8cadd5177a 100644
--- a/drivers/iio/orientation/hid-sensor-rotation.c
+++ b/drivers/iio/orientation/hid-sensor-rotation.c
@@ -327,7 +327,7 @@ static int hid_dev_rot_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_dev_rot_remove(struct platform_device *pdev)
+static void hid_dev_rot_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -336,8 +336,6 @@ static int hid_dev_rot_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, hsdev->usage);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &rot_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_dev_rot_ids[] = {
@@ -364,7 +362,7 @@ static struct platform_driver hid_dev_rot_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_dev_rot_probe,
- .remove = hid_dev_rot_remove,
+ .remove_new = hid_dev_rot_remove,
};
module_platform_driver(hid_dev_rot_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 43/49] iio: position: hid-sensor-custom-intel-hinge: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (41 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 42/49] iio: orientation: hid-sensor-rotation: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 44/49] iio: pressure: hid-sensor: " Uwe Kleine-König
` (8 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/position/hid-sensor-custom-intel-hinge.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/position/hid-sensor-custom-intel-hinge.c b/drivers/iio/position/hid-sensor-custom-intel-hinge.c
index 07c30d217255..76e173850a35 100644
--- a/drivers/iio/position/hid-sensor-custom-intel-hinge.c
+++ b/drivers/iio/position/hid-sensor-custom-intel-hinge.c
@@ -342,7 +342,7 @@ static int hid_hinge_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_hinge_remove(struct platform_device *pdev)
+static void hid_hinge_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -351,8 +351,6 @@ static int hid_hinge_remove(struct platform_device *pdev)
iio_device_unregister(indio_dev);
sensor_hub_remove_callback(hsdev, hsdev->usage);
hid_sensor_remove_trigger(indio_dev, &st->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_hinge_ids[] = {
@@ -371,7 +369,7 @@ static struct platform_driver hid_hinge_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_hinge_probe,
- .remove = hid_hinge_remove,
+ .remove_new = hid_hinge_remove,
};
module_platform_driver(hid_hinge_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 44/49] iio: pressure: hid-sensor: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (42 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 43/49] iio: position: hid-sensor-custom-intel-hinge: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 45/49] iio: proximity: cros_ec_mkbp: " Uwe Kleine-König
` (7 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/pressure/hid-sensor-press.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index a9215eb32d70..956045e2db29 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -323,7 +323,7 @@ static int hid_press_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_press_remove(struct platform_device *pdev)
+static void hid_press_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -332,8 +332,6 @@ static int hid_press_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_PRESSURE);
iio_device_unregister(indio_dev);
hid_sensor_remove_trigger(indio_dev, &press_state->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_press_ids[] = {
@@ -352,7 +350,7 @@ static struct platform_driver hid_press_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_press_probe,
- .remove = hid_press_remove,
+ .remove_new = hid_press_remove,
};
module_platform_driver(hid_press_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 45/49] iio: proximity: cros_ec_mkbp: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (43 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 44/49] iio: pressure: hid-sensor: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-20 7:45 ` Tzung-Bi Shih
2023-09-19 17:49 ` [PATCH 46/49] iio: proximity: srf04: " Uwe Kleine-König
` (6 subsequent siblings)
51 siblings, 1 reply; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Benson Leung, Guenter Roeck, linux-iio,
chrome-platform, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/proximity/cros_ec_mkbp_proximity.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/proximity/cros_ec_mkbp_proximity.c b/drivers/iio/proximity/cros_ec_mkbp_proximity.c
index 571ea1812246..4df506bb8b38 100644
--- a/drivers/iio/proximity/cros_ec_mkbp_proximity.c
+++ b/drivers/iio/proximity/cros_ec_mkbp_proximity.c
@@ -239,15 +239,13 @@ static int cros_ec_mkbp_proximity_probe(struct platform_device *pdev)
return 0;
}
-static int cros_ec_mkbp_proximity_remove(struct platform_device *pdev)
+static void cros_ec_mkbp_proximity_remove(struct platform_device *pdev)
{
struct cros_ec_mkbp_proximity_data *data = platform_get_drvdata(pdev);
struct cros_ec_device *ec = data->ec;
blocking_notifier_chain_unregister(&ec->event_notifier,
&data->notifier);
-
- return 0;
}
static const struct of_device_id cros_ec_mkbp_proximity_of_match[] = {
@@ -263,7 +261,7 @@ static struct platform_driver cros_ec_mkbp_proximity_driver = {
.pm = pm_sleep_ptr(&cros_ec_mkbp_proximity_pm_ops),
},
.probe = cros_ec_mkbp_proximity_probe,
- .remove = cros_ec_mkbp_proximity_remove,
+ .remove_new = cros_ec_mkbp_proximity_remove,
};
module_platform_driver(cros_ec_mkbp_proximity_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* Re: [PATCH 45/49] iio: proximity: cros_ec_mkbp: Convert to platform remove callback returning void
2023-09-19 17:49 ` [PATCH 45/49] iio: proximity: cros_ec_mkbp: " Uwe Kleine-König
@ 2023-09-20 7:45 ` Tzung-Bi Shih
0 siblings, 0 replies; 58+ messages in thread
From: Tzung-Bi Shih @ 2023-09-20 7:45 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jonathan Cameron, Lars-Peter Clausen, Benson Leung, Guenter Roeck,
linux-iio, chrome-platform, kernel
On Tue, Sep 19, 2023 at 07:49:27PM +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
^ permalink raw reply [flat|nested] 58+ messages in thread
* [PATCH 46/49] iio: proximity: srf04: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (44 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 45/49] iio: proximity: cros_ec_mkbp: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 47/49] iio: temperature: hid-sensor: " Uwe Kleine-König
` (5 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Andreas Klinger, Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/proximity/srf04.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/proximity/srf04.c b/drivers/iio/proximity/srf04.c
index faf2f806ce80..86c57672fc7e 100644
--- a/drivers/iio/proximity/srf04.c
+++ b/drivers/iio/proximity/srf04.c
@@ -344,7 +344,7 @@ static int srf04_probe(struct platform_device *pdev)
return ret;
}
-static int srf04_remove(struct platform_device *pdev)
+static void srf04_remove(struct platform_device *pdev)
{
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct srf04_data *data = iio_priv(indio_dev);
@@ -355,8 +355,6 @@ static int srf04_remove(struct platform_device *pdev)
pm_runtime_disable(data->dev);
pm_runtime_set_suspended(data->dev);
}
-
- return 0;
}
static int srf04_pm_runtime_suspend(struct device *dev)
@@ -391,7 +389,7 @@ static const struct dev_pm_ops srf04_pm_ops = {
static struct platform_driver srf04_driver = {
.probe = srf04_probe,
- .remove = srf04_remove,
+ .remove_new = srf04_remove,
.driver = {
.name = "srf04-gpio",
.of_match_table = of_srf04_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 47/49] iio: temperature: hid-sensor: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (45 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 46/49] iio: proximity: srf04: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 48/49] iio: trigger: iio-trig-interrupt: " Uwe Kleine-König
` (4 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/temperature/hid-sensor-temperature.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/temperature/hid-sensor-temperature.c b/drivers/iio/temperature/hid-sensor-temperature.c
index d40f235af1d4..0143fd478933 100644
--- a/drivers/iio/temperature/hid-sensor-temperature.c
+++ b/drivers/iio/temperature/hid-sensor-temperature.c
@@ -257,7 +257,7 @@ static int hid_temperature_probe(struct platform_device *pdev)
}
/* Function to deinitialize the processing for usage id */
-static int hid_temperature_remove(struct platform_device *pdev)
+static void hid_temperature_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -265,8 +265,6 @@ static int hid_temperature_remove(struct platform_device *pdev)
sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE);
hid_sensor_remove_trigger(indio_dev, &temp_st->common_attributes);
-
- return 0;
}
static const struct platform_device_id hid_temperature_ids[] = {
@@ -285,7 +283,7 @@ static struct platform_driver hid_temperature_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_temperature_probe,
- .remove = hid_temperature_remove,
+ .remove_new = hid_temperature_remove,
};
module_platform_driver(hid_temperature_platform_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 48/49] iio: trigger: iio-trig-interrupt: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (46 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 47/49] iio: temperature: hid-sensor: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-19 17:49 ` [PATCH 49/49] iio: trigger: stm32-timer: " Uwe Kleine-König
` (3 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: Lars-Peter Clausen, linux-iio, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/trigger/iio-trig-interrupt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/trigger/iio-trig-interrupt.c b/drivers/iio/trigger/iio-trig-interrupt.c
index 5f49cd105fae..dec256bfbd73 100644
--- a/drivers/iio/trigger/iio-trig-interrupt.c
+++ b/drivers/iio/trigger/iio-trig-interrupt.c
@@ -81,7 +81,7 @@ static int iio_interrupt_trigger_probe(struct platform_device *pdev)
return ret;
}
-static int iio_interrupt_trigger_remove(struct platform_device *pdev)
+static void iio_interrupt_trigger_remove(struct platform_device *pdev)
{
struct iio_trigger *trig;
struct iio_interrupt_trigger_info *trig_info;
@@ -92,13 +92,11 @@ static int iio_interrupt_trigger_remove(struct platform_device *pdev)
free_irq(trig_info->irq, trig);
kfree(trig_info);
iio_trigger_free(trig);
-
- return 0;
}
static struct platform_driver iio_interrupt_trigger_driver = {
.probe = iio_interrupt_trigger_probe,
- .remove = iio_interrupt_trigger_remove,
+ .remove_new = iio_interrupt_trigger_remove,
.driver = {
.name = "iio_interrupt_trigger",
},
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* [PATCH 49/49] iio: trigger: stm32-timer: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (47 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 48/49] iio: trigger: iio-trig-interrupt: " Uwe Kleine-König
@ 2023-09-19 17:49 ` Uwe Kleine-König
2023-09-23 17:35 ` [PATCH 00/49] iio: " Jonathan Cameron
` (2 subsequent siblings)
51 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 17:49 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue, linux-iio,
linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/iio/trigger/stm32-timer-trigger.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
index 3643c4afae67..d76444030a28 100644
--- a/drivers/iio/trigger/stm32-timer-trigger.c
+++ b/drivers/iio/trigger/stm32-timer-trigger.c
@@ -809,7 +809,7 @@ static int stm32_timer_trigger_probe(struct platform_device *pdev)
return 0;
}
-static int stm32_timer_trigger_remove(struct platform_device *pdev)
+static void stm32_timer_trigger_remove(struct platform_device *pdev)
{
struct stm32_timer_trigger *priv = platform_get_drvdata(pdev);
u32 val;
@@ -824,8 +824,6 @@ static int stm32_timer_trigger_remove(struct platform_device *pdev)
if (priv->enabled)
clk_disable(priv->clk);
-
- return 0;
}
static int stm32_timer_trigger_suspend(struct device *dev)
@@ -904,7 +902,7 @@ MODULE_DEVICE_TABLE(of, stm32_trig_of_match);
static struct platform_driver stm32_timer_trigger_driver = {
.probe = stm32_timer_trigger_probe,
- .remove = stm32_timer_trigger_remove,
+ .remove_new = stm32_timer_trigger_remove,
.driver = {
.name = "stm32-timer-trigger",
.of_match_table = stm32_trig_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 58+ messages in thread* Re: [PATCH 00/49] iio: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (48 preceding siblings ...)
2023-09-19 17:49 ` [PATCH 49/49] iio: trigger: stm32-timer: " Uwe Kleine-König
@ 2023-09-23 17:35 ` Jonathan Cameron
2023-11-13 3:23 ` patchwork-bot+chrome-platform
2023-11-13 3:42 ` patchwork-bot+chrome-platform
51 siblings, 0 replies; 58+ messages in thread
From: Jonathan Cameron @ 2023-09-23 17:35 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Jiri Kosina, Srinivas Pandruvada, Lars-Peter Clausen, linux-input,
linux-iio, kernel, Linus Walleij, linux-arm-kernel, Eugen Hristev,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Jinjie Ruan,
Rob Herring, Heiko Stuebner, Yang Yingliang, Chen-Yu Tsai,
Aidan MacDonald, Andy Shevchenko, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Hartley Sweeten,
Alexander Sverdlin, Krzysztof Kozlowski, Alim Akhtar,
linux-samsung-soc, Shawn Guo, Sascha Hauer, Fabio Estevam,
NXP Linux Team, Andreas Klinger, Cai Huoqing, Haibo Chen,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
George Stark, Andy Shevchenko, Nuno Sá, linux-amlogic,
Saravanan Sekar, Jiakai Luo, Dongliang Mu, Avi Fishman,
Tomer Maimon, Tali Perry, Patrick Venture, Nancy Yuen,
Benjamin Fair, openbmc, Andy Gross, Bjorn Andersson,
Konrad Dybcio, linux-arm-msm, Marek Vasut, Maxime Coquelin,
Alexandre Torgue, Olivier Moysan, Fabrice Gasnier, Zhang Shurong,
Yangtao Li, linux-stm32, Sean Nyekjaer, Tom Rix, Jernej Skrabec,
Samuel Holland, Rafael J. Wysocki, Damien Le Moal, Mark Brown,
Ido Schimmel, Daniel Lezcano, linux-sunxi, Dmitry Torokhov,
Andreas Kemnade, Peter Rosin, Vladimir Zapolskiy, Kevin Tsai,
Benson Leung, Guenter Roeck, chrome-platform
On Tue, 19 Sep 2023 19:48:42 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
> this series converts all platform drivers below drivers/iio to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side. As all platform drivers return zero unconditionally in their
> remove callback up to now, the conversions are "trivial".
>
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
>
> There are no interdependencies between the patches. As there are still
> quite a few drivers to convert, I'm happy about every patch that makes
> it in. So even if there is a merge conflict with one patch until you
> apply or I picked a wrong subject prefix, please apply the remainder of
> this series anyhow.
>
Series applied to the togreg branch of iio.git and pushed out as testing
to see if 0-day finds anything we are missing.
I've picked up all tags give as of early today.
Thanks,
Jonathan
> Best regards
> Uwe
>
> Uwe Kleine-König (49):
> iio: accel: hid-sensor-accel-3d: Convert to platform remove callback
> returning void
> iio: adc: ab8500-gpadc: Convert to platform remove callback returning
> void
> iio: adc: at91-sama5d2: Convert to platform remove callback returning
> void
> iio: adc: at91: Convert to platform remove callback returning void
> iio: adc: axp20x: Convert to platform remove callback returning void
> iio: adc: bcm_iproc: Convert to platform remove callback returning
> void
> iio: adc: dln2: Convert to platform remove callback returning void
> iio: adc: ep93xx: Convert to platform remove callback returning void
> iio: adc: exynos: Convert to platform remove callback returning void
> iio: adc: fsl-imx25-gcq: Convert to platform remove callback returning
> void
> iio: adc: hx711: Convert to platform remove callback returning void
> iio: adc: imx8qxp: Convert to platform remove callback returning void
> iio: adc: imx93: Convert to platform remove callback returning void
> iio: adc: meson_saradc: Convert to platform remove callback returning
> void
> iio: adc: mp2629: Convert to platform remove callback returning void
> iio: adc: mxs-lradc: Convert to platform remove callback returning
> void
> iio: adc: npcm: Convert to platform remove callback returning void
> iio: adc: qcom-pm8xxx-xoadc: Convert to platform remove callback
> returning void
> iio: adc: rcar-gyroadc: Convert to platform remove callback returning
> void
> iio: adc: stm32-adc-core: Convert to platform remove callback
> returning void
> iio: adc: stm32-adc: Convert to platform remove callback returning
> void
> iio: adc: stm32-dfsdm-adc: Convert to platform remove callback
> returning void
> iio: adc: stm32-dfsdm-core: Convert to platform remove callback
> returning void
> iio: adc: sun4i-gpadc-iio: Convert to platform remove callback
> returning void
> iio: adc: ti_am335x_adc: Convert to platform remove callback returning
> void
> iio: adc: twl4030-madc: Convert to platform remove callback returning
> void
> iio: adc: twl6030-gpadc: Convert to platform remove callback returning
> void
> iio: adc: vf610_adc: Convert to platform remove callback returning
> void
> iio: dac: dpot-dac: Convert to platform remove callback returning void
> iio: dac: lpc18xx_dac: Convert to platform remove callback returning
> void
> iio: dac: stm32-dac-core: Convert to platform remove callback
> returning void
> iio: dac: stm32-dac: Convert to platform remove callback returning
> void
> iio: dac: vf610: Convert to platform remove callback returning void
> iio: gyro: hid-sensor-gyro-3d: Convert to platform remove callback
> returning void
> iio: humidity: hid-sensor-humidity: Convert to platform remove
> callback returning void
> iio: light: cm3605: Convert to platform remove callback returning void
> iio: light: hid-sensor-als: Convert to platform remove callback
> returning void
> iio: light: hid-sensor-prox: Convert to platform remove callback
> returning void
> iio: light: lm3533-als: Convert to platform remove callback returning
> void
> iio: magnetometer: hid-sensor-magn-3d: Convert to platform remove
> callback returning void
> iio: orientation: hid-sensor-incl-3d: Convert to platform remove
> callback returning void
> iio: orientation: hid-sensor-rotation: Convert to platform remove
> callback returning void
> iio: position: hid-sensor-custom-intel-hinge: Convert to platform
> remove callback returning void
> iio: pressure: hid-sensor: Convert to platform remove callback
> returning void
> iio: proximity: cros_ec_mkbp: Convert to platform remove callback
> returning void
> iio: proximity: srf04: Convert to platform remove callback returning
> void
> iio: temperature: hid-sensor: Convert to platform remove callback
> returning void
> iio: trigger: iio-trig-interrupt: Convert to platform remove callback
> returning void
> iio: trigger: stm32-timer: Convert to platform remove callback
> returning void
>
> drivers/iio/accel/hid-sensor-accel-3d.c | 6 ++----
> drivers/iio/adc/ab8500-gpadc.c | 6 ++----
> drivers/iio/adc/at91-sama5d2_adc.c | 6 ++----
> drivers/iio/adc/at91_adc.c | 6 ++----
> drivers/iio/adc/axp20x_adc.c | 6 ++----
> drivers/iio/adc/bcm_iproc_adc.c | 6 ++----
> drivers/iio/adc/dln2-adc.c | 5 ++---
> drivers/iio/adc/ep93xx_adc.c | 6 ++----
> drivers/iio/adc/exynos_adc.c | 6 ++----
> drivers/iio/adc/fsl-imx25-gcq.c | 6 ++----
> drivers/iio/adc/hx711.c | 6 ++----
> drivers/iio/adc/imx8qxp-adc.c | 6 ++----
> drivers/iio/adc/imx93_adc.c | 6 ++----
> drivers/iio/adc/meson_saradc.c | 6 ++----
> drivers/iio/adc/mp2629_adc.c | 6 ++----
> drivers/iio/adc/mxs-lradc-adc.c | 6 ++----
> drivers/iio/adc/npcm_adc.c | 6 ++----
> drivers/iio/adc/qcom-pm8xxx-xoadc.c | 6 ++----
> drivers/iio/adc/rcar-gyroadc.c | 6 ++----
> drivers/iio/adc/stm32-adc-core.c | 6 ++----
> drivers/iio/adc/stm32-adc.c | 6 ++----
> drivers/iio/adc/stm32-dfsdm-adc.c | 6 ++----
> drivers/iio/adc/stm32-dfsdm-core.c | 6 ++----
> drivers/iio/adc/sun4i-gpadc-iio.c | 8 +++-----
> drivers/iio/adc/ti_am335x_adc.c | 6 ++----
> drivers/iio/adc/twl4030-madc.c | 6 ++----
> drivers/iio/adc/twl6030-gpadc.c | 6 ++----
> drivers/iio/adc/vf610_adc.c | 6 ++----
> drivers/iio/dac/dpot-dac.c | 6 ++----
> drivers/iio/dac/lpc18xx_dac.c | 6 ++----
> drivers/iio/dac/stm32-dac-core.c | 6 ++----
> drivers/iio/dac/stm32-dac.c | 6 ++----
> drivers/iio/dac/vf610_dac.c | 6 ++----
> drivers/iio/gyro/hid-sensor-gyro-3d.c | 6 ++----
> drivers/iio/humidity/hid-sensor-humidity.c | 6 ++----
> drivers/iio/light/cm3605.c | 6 ++----
> drivers/iio/light/hid-sensor-als.c | 6 ++----
> drivers/iio/light/hid-sensor-prox.c | 6 ++----
> drivers/iio/light/lm3533-als.c | 6 ++----
> drivers/iio/magnetometer/hid-sensor-magn-3d.c | 6 ++----
> drivers/iio/orientation/hid-sensor-incl-3d.c | 6 ++----
> drivers/iio/orientation/hid-sensor-rotation.c | 6 ++----
> drivers/iio/position/hid-sensor-custom-intel-hinge.c | 6 ++----
> drivers/iio/pressure/hid-sensor-press.c | 6 ++----
> drivers/iio/proximity/cros_ec_mkbp_proximity.c | 6 ++----
> drivers/iio/proximity/srf04.c | 6 ++----
> drivers/iio/temperature/hid-sensor-temperature.c | 6 ++----
> drivers/iio/trigger/iio-trig-interrupt.c | 6 ++----
> drivers/iio/trigger/stm32-timer-trigger.c | 6 ++----
> 49 files changed, 99 insertions(+), 196 deletions(-)
>
>
> base-commit: 29e400e3ea486bf942b214769fc9778098114113
^ permalink raw reply [flat|nested] 58+ messages in thread* Re: [PATCH 00/49] iio: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (49 preceding siblings ...)
2023-09-23 17:35 ` [PATCH 00/49] iio: " Jonathan Cameron
@ 2023-11-13 3:23 ` patchwork-bot+chrome-platform
2023-11-13 3:42 ` patchwork-bot+chrome-platform
51 siblings, 0 replies; 58+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-11-13 3:23 UTC (permalink / raw)
To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
Cc: jic23, jikos, srinivas.pandruvada, lars, linux-input, linux-iio,
kernel, linus.walleij, linux-arm-kernel, eugen.hristev,
nicolas.ferre, alexandre.belloni, claudiu.beznea, ruanjinjie,
robh, heiko, yangyingliang, wens, aidanmacdonald.0x0,
andy.shevchenko, rjui, sbranden, bcm-kernel-feedback-list,
hsweeten, alexander.sverdlin, krzysztof.kozlowski, alim.akhtar,
linux-samsung-soc, shawnguo, s.hauer, festevam, linux-imx, ak,
cai.huoqing, haibo.chen, neil.armstrong, khilman, jbrunet,
martin.blumenstingl, gnstark, andriy.shevchenko, nuno.sa,
linux-amlogic, sravanhome, jkluo, dzm91, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair, openbmc, agross,
andersson, konrad.dybcio, linux-arm-msm, marek.vasut,
mcoquelin.stm32, alexandre.torgue, olivier.moysan,
fabrice.gasnier, zhang_shurong, frank.li, linux-stm32, sean, trix,
jernej.skrabec, samuel, rafael.j.wysocki, damien.lemoal, broonie,
idosch, daniel.lezcano, linux-sunxi, dmitry.torokhov, andreas,
peda, vz, ktsai, bleung, groeck, chrome-platform
Hello:
This patch was applied to chrome-platform/linux.git (for-kernelci)
by Jonathan Cameron <Jonathan.Cameron@huawei.com>:
On Tue, 19 Sep 2023 19:48:42 +0200 you wrote:
> this series converts all platform drivers below drivers/iio to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side. As all platform drivers return zero unconditionally in their
> remove callback up to now, the conversions are "trivial".
>
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
>
> [...]
Here is the summary with links:
- [45/49] iio: proximity: cros_ec_mkbp: Convert to platform remove callback returning void
https://git.kernel.org/chrome-platform/c/2df694f710d2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 58+ messages in thread* Re: [PATCH 00/49] iio: Convert to platform remove callback returning void
2023-09-19 17:48 [PATCH 00/49] iio: Convert to platform remove callback returning void Uwe Kleine-König
` (50 preceding siblings ...)
2023-11-13 3:23 ` patchwork-bot+chrome-platform
@ 2023-11-13 3:42 ` patchwork-bot+chrome-platform
51 siblings, 0 replies; 58+ messages in thread
From: patchwork-bot+chrome-platform @ 2023-11-13 3:42 UTC (permalink / raw)
To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
Cc: jic23, jikos, srinivas.pandruvada, lars, linux-input, linux-iio,
kernel, linus.walleij, linux-arm-kernel, eugen.hristev,
nicolas.ferre, alexandre.belloni, claudiu.beznea, ruanjinjie,
robh, heiko, yangyingliang, wens, aidanmacdonald.0x0,
andy.shevchenko, rjui, sbranden, bcm-kernel-feedback-list,
hsweeten, alexander.sverdlin, krzysztof.kozlowski, alim.akhtar,
linux-samsung-soc, shawnguo, s.hauer, festevam, linux-imx, ak,
cai.huoqing, haibo.chen, neil.armstrong, khilman, jbrunet,
martin.blumenstingl, gnstark, andriy.shevchenko, nuno.sa,
linux-amlogic, sravanhome, jkluo, dzm91, avifishman70, tmaimon77,
tali.perry1, venture, yuenn, benjaminfair, openbmc, agross,
andersson, konrad.dybcio, linux-arm-msm, marek.vasut,
mcoquelin.stm32, alexandre.torgue, olivier.moysan,
fabrice.gasnier, zhang_shurong, frank.li, linux-stm32, sean, trix,
jernej.skrabec, samuel, rafael.j.wysocki, damien.lemoal, broonie,
idosch, daniel.lezcano, linux-sunxi, dmitry.torokhov, andreas,
peda, vz, ktsai, bleung, groeck, chrome-platform
Hello:
This patch was applied to chrome-platform/linux.git (for-next)
by Jonathan Cameron <Jonathan.Cameron@huawei.com>:
On Tue, 19 Sep 2023 19:48:42 +0200 you wrote:
> this series converts all platform drivers below drivers/iio to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side. As all platform drivers return zero unconditionally in their
> remove callback up to now, the conversions are "trivial".
>
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
>
> [...]
Here is the summary with links:
- [45/49] iio: proximity: cros_ec_mkbp: Convert to platform remove callback returning void
https://git.kernel.org/chrome-platform/c/2df694f710d2
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 58+ messages in thread