* [PATCH 00/24] staging: Convert to platform remove callback returning void
@ 2023-04-03 15:39 Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 01/24] staging: axis-fifo: " Uwe Kleine-König
` (24 more replies)
0 siblings, 25 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Greg Kroah-Hartman, Deepak R Varma, Yuan Can, Simon Horman,
Sven Van Asbroeck, Vaibhav Hiremath, Johan Hovold, Alex Elder,
Eugen Hristev, Mauro Carvalho Chehab, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea, Steve Longerbeam,
Philipp Zabel, Shawn Guo, Sascha Hauer, Neil Armstrong,
Kevin Hilman, Laurent Pinchart, Ezequiel Garcia, Maxime Ripard,
Paul Kocialkowski, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
Parthiban Veerasooran, Christian Gromm, Davidlohr Bueso,
Marc Dietrich, Florian Fainelli, Ray Jui, Scott Branden,
Umang Jain, Andy Shevchenko, Adrien Thierry, Stefan Wahren,
Fabio M. De Francesco, Phil Elwell, Jakob Koschel
Cc: linux-staging, kernel, greybus-dev, linux-media, linux-arm-kernel,
Fabio Estevam, NXP Linux Team, Jerome Brunet, Martin Blumenstingl,
linux-amlogic, linux-rockchip, linux-sunxi, ac100, linux-tegra,
Broadcom internal kernel review list, linux-rpi-kernel
Hello,
this series adapts the platform drivers below drivers/staging to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver
core doesn't (and cannot) cope for errors during remove. The only effect
of a non-zero return value in .remove() is that the driver core emits a
warning. The device is removed anyhow and an early return from .remove()
usually yields a resource leak.
By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.
All drivers in staging already return zero in their remove callback, so
they can be trivially converted.
The changes to the individual drivers are all orthogonal. If I need to
resend some patches because of some review feedback, I'd like to only
send the patches that actually needed changes, so please pick up the
remaining patches that don't need changing to reduce the amount of mail.
Best regards
Uwe
Uwe Kleine-König (24):
staging: axis-fifo: Convert to platform remove callback returning void
staging: emxx_udc: Convert to platform remove callback returning void
staging: fieldbus: arcx-anybus: Convert to platform remove callback
returning void
staging: greybus: arche-apb-ctrl: Convert to platform remove callback
returning void
staging: greybus: arche: Convert to platform remove callback returning
void
staging: media: atmel-sama5d2-isc: Convert to platform remove callback
returning void
staging: media: atmel-sama7g5-isc: Convert to platform remove callback
returning void
staging: media: imx-media-csi: Convert to platform remove callback
returning void
staging: media: imx-media-dev: Convert to platform remove callback
returning void
staging: media: imx6-mipi-csi2: Convert to platform remove callback
returning void
staging: media: imx8mq-mipi-csi2: Convert to platform remove callback
returning void
staging: media: meson: vdec: Convert to platform remove callback
returning void
staging: media: omap4iss: Convert to platform remove callback
returning void
staging: media: rkvdec: Convert to platform remove callback returning
void
staging: media: sunxi: cedrus: Convert to platform remove callback
returning void
staging: media: sun6i-isp: Convert to platform remove callback
returning void
staging: most: dim2: Convert to platform remove callback returning
void
staging: nvec: Convert to platform remove callback returning void
staging: nvec: nvec_kbd: Convert to platform remove callback returning
void
staging: nvec_power: Convert to platform remove callback returning
void
staging: nvec_ps2: Convert to platform remove callback returning void
staging: octeon: ethernet: Convert to platform remove callback
returning void
staging: vc04_services: bcm2835-camera: Convert to platform remove
callback returning void
staging: vc04_services: vchiq_arm: Convert to platform remove callback
returning void
drivers/staging/axis-fifo/axis-fifo.c | 6 ++----
drivers/staging/emxx_udc/emxx_udc.c | 6 ++----
drivers/staging/fieldbus/anybuss/arcx-anybus.c | 5 ++---
drivers/staging/greybus/arche-apb-ctrl.c | 6 ++----
drivers/staging/greybus/arche-platform.c | 6 ++----
drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 6 ++----
drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 6 ++----
drivers/staging/media/imx/imx-media-csi.c | 6 ++----
drivers/staging/media/imx/imx-media-dev.c | 6 ++----
drivers/staging/media/imx/imx6-mipi-csi2.c | 6 ++----
drivers/staging/media/imx/imx8mq-mipi-csi2.c | 6 ++----
drivers/staging/media/meson/vdec/vdec.c | 6 ++----
drivers/staging/media/omap4iss/iss.c | 6 ++----
drivers/staging/media/rkvdec/rkvdec.c | 5 ++---
drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++----
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 6 ++----
drivers/staging/most/dim2/dim2.c | 6 ++----
drivers/staging/nvec/nvec.c | 6 ++----
drivers/staging/nvec/nvec_kbd.c | 6 ++----
drivers/staging/nvec/nvec_power.c | 6 ++----
drivers/staging/nvec/nvec_ps2.c | 6 ++----
drivers/staging/octeon/ethernet.c | 5 ++---
.../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 6 ++----
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++----
24 files changed, 48 insertions(+), 93 deletions(-)
base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
--
2.39.2
^ permalink raw reply [flat|nested] 39+ messages in thread
* [PATCH 01/24] staging: axis-fifo: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 02/24] staging: emxx_udc: " Uwe Kleine-König
` (23 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/axis-fifo/axis-fifo.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index dfd2b357f484..13ff42cb0db0 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -920,15 +920,13 @@ static int axis_fifo_probe(struct platform_device *pdev)
return rc;
}
-static int axis_fifo_remove(struct platform_device *pdev)
+static void axis_fifo_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct axis_fifo *fifo = dev_get_drvdata(dev);
misc_deregister(&fifo->miscdev);
dev_set_drvdata(dev, NULL);
-
- return 0;
}
static const struct of_device_id axis_fifo_of_match[] = {
@@ -943,7 +941,7 @@ static struct platform_driver axis_fifo_driver = {
.of_match_table = axis_fifo_of_match,
},
.probe = axis_fifo_probe,
- .remove = axis_fifo_remove,
+ .remove_new = axis_fifo_remove,
};
static int __init axis_fifo_init(void)
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 02/24] staging: emxx_udc: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 01/24] staging: axis-fifo: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 03/24] staging: fieldbus: arcx-anybus: " Uwe Kleine-König
` (22 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Greg Kroah-Hartman, Deepak R Varma, Yuan Can, Simon Horman
Cc: linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/emxx_udc/emxx_udc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c
index f9765841c4aa..eb63daaca702 100644
--- a/drivers/staging/emxx_udc/emxx_udc.c
+++ b/drivers/staging/emxx_udc/emxx_udc.c
@@ -3137,7 +3137,7 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
}
/*-------------------------------------------------------------------------*/
-static int nbu2ss_drv_remove(struct platform_device *pdev)
+static void nbu2ss_drv_remove(struct platform_device *pdev)
{
struct nbu2ss_udc *udc;
struct nbu2ss_ep *ep;
@@ -3154,8 +3154,6 @@ static int nbu2ss_drv_remove(struct platform_device *pdev)
/* Interrupt Handler - Release */
free_irq(vbus_irq, udc);
-
- return 0;
}
/*-------------------------------------------------------------------------*/
@@ -3210,7 +3208,7 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
static struct platform_driver udc_driver = {
.probe = nbu2ss_drv_probe,
.shutdown = nbu2ss_drv_shutdown,
- .remove = nbu2ss_drv_remove,
+ .remove_new = nbu2ss_drv_remove,
.suspend = nbu2ss_drv_suspend,
.resume = nbu2ss_drv_resume,
.driver = {
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 03/24] staging: fieldbus: arcx-anybus: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 01/24] staging: axis-fifo: " Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 02/24] staging: emxx_udc: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 04/24] staging: greybus: arche-apb-ctrl: " Uwe Kleine-König
` (21 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Sven Van Asbroeck, Greg Kroah-Hartman; +Cc: linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/fieldbus/anybuss/arcx-anybus.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
index 9af2e63050d1..afef35bbea74 100644
--- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c
+++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c
@@ -321,7 +321,7 @@ static int controller_probe(struct platform_device *pdev)
return err;
}
-static int controller_remove(struct platform_device *pdev)
+static void controller_remove(struct platform_device *pdev)
{
struct controller_priv *cd = platform_get_drvdata(pdev);
int id = cd->class_dev->id;
@@ -329,7 +329,6 @@ static int controller_remove(struct platform_device *pdev)
device_unregister(cd->class_dev);
ida_simple_remove(&controller_index_ida, id);
gpiod_set_value_cansleep(cd->reset_gpiod, 1);
- return 0;
}
static const struct of_device_id controller_of_match[] = {
@@ -341,7 +340,7 @@ MODULE_DEVICE_TABLE(of, controller_of_match);
static struct platform_driver controller_driver = {
.probe = controller_probe,
- .remove = controller_remove,
+ .remove_new = controller_remove,
.driver = {
.name = "arcx-anybus-controller",
.of_match_table = of_match_ptr(controller_of_match),
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 04/24] staging: greybus: arche-apb-ctrl: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 03/24] staging: fieldbus: arcx-anybus: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 05/24] staging: greybus: arche: " Uwe Kleine-König
` (20 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Vaibhav Hiremath, Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/greybus/arche-apb-ctrl.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
index 45afa208d004..8541995008da 100644
--- a/drivers/staging/greybus/arche-apb-ctrl.c
+++ b/drivers/staging/greybus/arche-apb-ctrl.c
@@ -419,13 +419,11 @@ static int arche_apb_ctrl_probe(struct platform_device *pdev)
return 0;
}
-static int arche_apb_ctrl_remove(struct platform_device *pdev)
+static void arche_apb_ctrl_remove(struct platform_device *pdev)
{
device_remove_file(&pdev->dev, &dev_attr_state);
poweroff_seq(pdev);
platform_set_drvdata(pdev, NULL);
-
- return 0;
}
static int __maybe_unused arche_apb_ctrl_suspend(struct device *dev)
@@ -471,7 +469,7 @@ static const struct of_device_id arche_apb_ctrl_of_match[] = {
static struct platform_driver arche_apb_ctrl_device_driver = {
.probe = arche_apb_ctrl_probe,
- .remove = arche_apb_ctrl_remove,
+ .remove_new = arche_apb_ctrl_remove,
.shutdown = arche_apb_ctrl_shutdown,
.driver = {
.name = "arche-apb-ctrl",
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 05/24] staging: greybus: arche: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (3 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 04/24] staging: greybus: arche-apb-ctrl: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 06/24] staging: media: atmel-sama5d2-isc: " Uwe Kleine-König
` (19 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Vaibhav Hiremath, Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/greybus/arche-platform.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
index fcbd5f71eff2..ebe835f25d13 100644
--- a/drivers/staging/greybus/arche-platform.c
+++ b/drivers/staging/greybus/arche-platform.c
@@ -559,7 +559,7 @@ static int arche_remove_child(struct device *dev, void *unused)
return 0;
}
-static int arche_platform_remove(struct platform_device *pdev)
+static void arche_platform_remove(struct platform_device *pdev)
{
struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
@@ -570,8 +570,6 @@ static int arche_platform_remove(struct platform_device *pdev)
if (usb3613_hub_mode_ctrl(false))
dev_warn(arche_pdata->dev, "failed to control hub device\n");
- /* TODO: Should we do anything more here ?? */
- return 0;
}
static __maybe_unused int arche_platform_suspend(struct device *dev)
@@ -631,7 +629,7 @@ MODULE_DEVICE_TABLE(of, arche_combined_id);
static struct platform_driver arche_platform_device_driver = {
.probe = arche_platform_probe,
- .remove = arche_platform_remove,
+ .remove_new = arche_platform_remove,
.shutdown = arche_platform_shutdown,
.driver = {
.name = "arche-platform-ctrl",
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 06/24] staging: media: atmel-sama5d2-isc: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (4 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 05/24] staging: greybus: arche: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 16:24 ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 07/24] staging: media: atmel-sama7g5-isc: " Uwe Kleine-König
` (18 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Eugen Hristev, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea
Cc: linux-media, linux-staging, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
index ba0614f981a2..cc744cea1d0e 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
@@ -580,7 +580,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
return ret;
}
-static int atmel_isc_remove(struct platform_device *pdev)
+static void atmel_isc_remove(struct platform_device *pdev)
{
struct isc_device *isc = platform_get_drvdata(pdev);
@@ -594,8 +594,6 @@ static int atmel_isc_remove(struct platform_device *pdev)
clk_disable_unprepare(isc->hclock);
atmel_isc_clk_cleanup(isc);
-
- return 0;
}
static int __maybe_unused isc_runtime_suspend(struct device *dev)
@@ -638,7 +636,7 @@ MODULE_DEVICE_TABLE(of, atmel_isc_of_match);
static struct platform_driver atmel_isc_driver = {
.probe = atmel_isc_probe,
- .remove = atmel_isc_remove,
+ .remove_new = atmel_isc_remove,
.driver = {
.name = "atmel-sama5d2-isc",
.pm = &atmel_isc_dev_pm_ops,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 07/24] staging: media: atmel-sama7g5-isc: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (5 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 06/24] staging: media: atmel-sama5d2-isc: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-03 16:23 ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 08/24] staging: media: imx-media-csi: " Uwe Kleine-König
` (17 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Eugen Hristev, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Nicolas Ferre, Alexandre Belloni, Claudiu Beznea
Cc: linux-media, linux-staging, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
index 01ababdfcbd9..315bfc4ac4ff 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
@@ -549,7 +549,7 @@ static int microchip_xisc_probe(struct platform_device *pdev)
return ret;
}
-static int microchip_xisc_remove(struct platform_device *pdev)
+static void microchip_xisc_remove(struct platform_device *pdev)
{
struct isc_device *isc = platform_get_drvdata(pdev);
@@ -562,8 +562,6 @@ static int microchip_xisc_remove(struct platform_device *pdev)
clk_disable_unprepare(isc->hclock);
atmel_isc_clk_cleanup(isc);
-
- return 0;
}
static int __maybe_unused xisc_runtime_suspend(struct device *dev)
@@ -601,7 +599,7 @@ MODULE_DEVICE_TABLE(of, microchip_xisc_of_match);
static struct platform_driver microchip_xisc_driver = {
.probe = microchip_xisc_probe,
- .remove = microchip_xisc_remove,
+ .remove_new = microchip_xisc_remove,
.driver = {
.name = "microchip-sama7g5-xisc",
.pm = µchip_xisc_dev_pm_ops,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 08/24] staging: media: imx-media-csi: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (6 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 07/24] staging: media: atmel-sama7g5-isc: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:39 ` [PATCH 09/24] staging: media: imx-media-dev: " Uwe Kleine-König
` (16 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/imx/imx-media-csi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 44d87fe30d52..097171bb930d 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -2041,7 +2041,7 @@ static int imx_csi_probe(struct platform_device *pdev)
return ret;
}
-static int imx_csi_remove(struct platform_device *pdev)
+static void imx_csi_remove(struct platform_device *pdev)
{
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csi_priv *priv = sd_to_dev(sd);
@@ -2052,8 +2052,6 @@ static int imx_csi_remove(struct platform_device *pdev)
v4l2_async_nf_cleanup(&priv->notifier);
v4l2_async_unregister_subdev(sd);
media_entity_cleanup(&sd->entity);
-
- return 0;
}
static const struct platform_device_id imx_csi_ids[] = {
@@ -2064,7 +2062,7 @@ MODULE_DEVICE_TABLE(platform, imx_csi_ids);
static struct platform_driver imx_csi_driver = {
.probe = imx_csi_probe,
- .remove = imx_csi_remove,
+ .remove_new = imx_csi_remove,
.id_table = imx_csi_ids,
.driver = {
.name = "imx-ipuv3-csi",
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 09/24] staging: media: imx-media-dev: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (7 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 08/24] staging: media: imx-media-csi: " Uwe Kleine-König
@ 2023-04-03 15:39 ` Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 10/24] staging: media: imx6-mipi-csi2: " Uwe Kleine-König
` (15 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:39 UTC (permalink / raw)
To: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/imx/imx-media-dev.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
index f85462214e22..c80113905069 100644
--- a/drivers/staging/media/imx/imx-media-dev.c
+++ b/drivers/staging/media/imx/imx-media-dev.c
@@ -101,7 +101,7 @@ static int imx_media_probe(struct platform_device *pdev)
return ret;
}
-static int imx_media_remove(struct platform_device *pdev)
+static void imx_media_remove(struct platform_device *pdev)
{
struct imx_media_dev *imxmd =
(struct imx_media_dev *)platform_get_drvdata(pdev);
@@ -119,8 +119,6 @@ static int imx_media_remove(struct platform_device *pdev)
media_device_unregister(&imxmd->md);
v4l2_device_unregister(&imxmd->v4l2_dev);
media_device_cleanup(&imxmd->md);
-
- return 0;
}
static const struct of_device_id imx_media_dt_ids[] = {
@@ -131,7 +129,7 @@ MODULE_DEVICE_TABLE(of, imx_media_dt_ids);
static struct platform_driver imx_media_pdrv = {
.probe = imx_media_probe,
- .remove = imx_media_remove,
+ .remove_new = imx_media_remove,
.driver = {
.name = "imx-media",
.of_match_table = imx_media_dt_ids,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 10/24] staging: media: imx6-mipi-csi2: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (8 preceding siblings ...)
2023-04-03 15:39 ` [PATCH 09/24] staging: media: imx-media-dev: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 11/24] staging: media: imx8mq-mipi-csi2: " Uwe Kleine-König
` (14 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/imx/imx6-mipi-csi2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c
index c4cb558a85c6..c07994ea6e96 100644
--- a/drivers/staging/media/imx/imx6-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx6-mipi-csi2.c
@@ -765,7 +765,7 @@ static int csi2_probe(struct platform_device *pdev)
return ret;
}
-static int csi2_remove(struct platform_device *pdev)
+static void csi2_remove(struct platform_device *pdev)
{
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csi2_dev *csi2 = sd_to_dev(sd);
@@ -777,8 +777,6 @@ static int csi2_remove(struct platform_device *pdev)
clk_disable_unprepare(csi2->pllref_clk);
mutex_destroy(&csi2->lock);
media_entity_cleanup(&sd->entity);
-
- return 0;
}
static const struct of_device_id csi2_dt_ids[] = {
@@ -793,7 +791,7 @@ static struct platform_driver csi2_driver = {
.of_match_table = csi2_dt_ids,
},
.probe = csi2_probe,
- .remove = csi2_remove,
+ .remove_new = csi2_remove,
};
module_platform_driver(csi2_driver);
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 11/24] staging: media: imx8mq-mipi-csi2: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (9 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 10/24] staging: media: imx6-mipi-csi2: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 12/24] staging: media: meson: vdec: " Uwe Kleine-König
` (13 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/imx/imx8mq-mipi-csi2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
index 83194328d010..4317f6b71892 100644
--- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c
+++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c
@@ -961,7 +961,7 @@ static int imx8mq_mipi_csi_probe(struct platform_device *pdev)
return ret;
}
-static int imx8mq_mipi_csi_remove(struct platform_device *pdev)
+static void imx8mq_mipi_csi_remove(struct platform_device *pdev)
{
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csi_state *state = mipi_sd_to_csi2_state(sd);
@@ -976,8 +976,6 @@ static int imx8mq_mipi_csi_remove(struct platform_device *pdev)
mutex_destroy(&state->lock);
pm_runtime_set_suspended(&pdev->dev);
imx8mq_mipi_csi_release_icc(pdev);
-
- return 0;
}
static const struct of_device_id imx8mq_mipi_csi_of_match[] = {
@@ -988,7 +986,7 @@ MODULE_DEVICE_TABLE(of, imx8mq_mipi_csi_of_match);
static struct platform_driver imx8mq_mipi_csi_driver = {
.probe = imx8mq_mipi_csi_probe,
- .remove = imx8mq_mipi_csi_remove,
+ .remove_new = imx8mq_mipi_csi_remove,
.driver = {
.of_match_table = imx8mq_mipi_csi_of_match,
.name = MIPI_CSI2_DRIVER_NAME,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 12/24] staging: media: meson: vdec: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (10 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 11/24] staging: media: imx8mq-mipi-csi2: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 20:38 ` Martin Blumenstingl
2023-04-03 15:40 ` [PATCH 13/24] staging: media: omap4iss: " Uwe Kleine-König
` (12 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Neil Armstrong, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-media, linux-amlogic,
linux-staging, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/meson/vdec/vdec.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c
index 52f224d8def1..5ca4b1200831 100644
--- a/drivers/staging/media/meson/vdec/vdec.c
+++ b/drivers/staging/media/meson/vdec/vdec.c
@@ -1106,19 +1106,17 @@ static int vdec_probe(struct platform_device *pdev)
return ret;
}
-static int vdec_remove(struct platform_device *pdev)
+static void vdec_remove(struct platform_device *pdev)
{
struct amvdec_core *core = platform_get_drvdata(pdev);
video_unregister_device(core->vdev_dec);
v4l2_device_unregister(&core->v4l2_dev);
-
- return 0;
}
static struct platform_driver meson_vdec_driver = {
.probe = vdec_probe,
- .remove = vdec_remove,
+ .remove_new = vdec_remove,
.driver = {
.name = "meson-vdec",
.of_match_table = vdec_dt_match,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 13/24] staging: media: omap4iss: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (11 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 12/24] staging: media: meson: vdec: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-04 2:25 ` Laurent Pinchart
2023-04-03 15:40 ` [PATCH 14/24] staging: media: rkvdec: " Uwe Kleine-König
` (11 subsequent siblings)
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Laurent Pinchart, Mauro Carvalho Chehab, Greg Kroah-Hartman
Cc: linux-media, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/omap4iss/iss.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
index fa2a36d829d3..0c4283bb48ad 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -1323,15 +1323,13 @@ static int iss_probe(struct platform_device *pdev)
return ret;
}
-static int iss_remove(struct platform_device *pdev)
+static void iss_remove(struct platform_device *pdev)
{
struct iss_device *iss = platform_get_drvdata(pdev);
iss_unregister_entities(iss);
media_entity_enum_cleanup(&iss->crashed);
iss_cleanup_modules(iss);
-
- return 0;
}
static const struct platform_device_id omap4iss_id_table[] = {
@@ -1342,7 +1340,7 @@ MODULE_DEVICE_TABLE(platform, omap4iss_id_table);
static struct platform_driver iss_driver = {
.probe = iss_probe,
- .remove = iss_remove,
+ .remove_new = iss_remove,
.id_table = omap4iss_id_table,
.driver = {
.name = "omap4iss",
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 14/24] staging: media: rkvdec: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (12 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 13/24] staging: media: omap4iss: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
` (10 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Ezequiel Garcia, Mauro Carvalho Chehab, Greg Kroah-Hartman
Cc: linux-media, linux-rockchip, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/rkvdec/rkvdec.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c
index 7bab7586918c..3df977653ba5 100644
--- a/drivers/staging/media/rkvdec/rkvdec.c
+++ b/drivers/staging/media/rkvdec/rkvdec.c
@@ -1062,14 +1062,13 @@ static int rkvdec_probe(struct platform_device *pdev)
return ret;
}
-static int rkvdec_remove(struct platform_device *pdev)
+static void rkvdec_remove(struct platform_device *pdev)
{
struct rkvdec_dev *rkvdec = platform_get_drvdata(pdev);
rkvdec_v4l2_cleanup(rkvdec);
pm_runtime_disable(&pdev->dev);
pm_runtime_dont_use_autosuspend(&pdev->dev);
- return 0;
}
#ifdef CONFIG_PM
@@ -1099,7 +1098,7 @@ static const struct dev_pm_ops rkvdec_pm_ops = {
static struct platform_driver rkvdec_driver = {
.probe = rkvdec_probe,
- .remove = rkvdec_remove,
+ .remove_new = rkvdec_remove,
.driver = {
.name = "rkvdec",
.of_match_table = of_rkvdec_match,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 15/24] staging: media: sunxi: cedrus: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (13 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 14/24] staging: media: rkvdec: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:53 ` Jernej Škrabec
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
` (9 subsequent siblings)
24 siblings, 2 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: linux-media, linux-staging, linux-arm-kernel, linux-sunxi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index a43d5ff66716..3c62376c3e94 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -543,7 +543,7 @@ static int cedrus_probe(struct platform_device *pdev)
return ret;
}
-static int cedrus_remove(struct platform_device *pdev)
+static void cedrus_remove(struct platform_device *pdev)
{
struct cedrus_dev *dev = platform_get_drvdata(pdev);
@@ -558,8 +558,6 @@ static int cedrus_remove(struct platform_device *pdev)
v4l2_device_unregister(&dev->v4l2_dev);
cedrus_hw_remove(dev);
-
- return 0;
}
static const struct cedrus_variant sun4i_a10_cedrus_variant = {
@@ -706,7 +704,7 @@ static const struct dev_pm_ops cedrus_dev_pm_ops = {
static struct platform_driver cedrus_driver = {
.probe = cedrus_probe,
- .remove = cedrus_remove,
+ .remove_new = cedrus_remove,
.driver = {
.name = CEDRUS_NAME,
.of_match_table = of_match_ptr(cedrus_dt_match),
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 16/24] staging: media: sun6i-isp: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (14 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:54 ` Jernej Škrabec
2023-04-03 15:40 ` [PATCH 17/24] staging: most: dim2: " Uwe Kleine-König
` (8 subsequent siblings)
24 siblings, 2 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Paul Kocialkowski, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland
Cc: linux-media, linux-staging, linux-arm-kernel, linux-sunxi, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
index 7b7947509b69..0dc75adbd9d8 100644
--- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
+++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
@@ -493,7 +493,7 @@ static int sun6i_isp_probe(struct platform_device *platform_dev)
return ret;
}
-static int sun6i_isp_remove(struct platform_device *platform_dev)
+static void sun6i_isp_remove(struct platform_device *platform_dev)
{
struct sun6i_isp_device *isp_dev = platform_get_drvdata(platform_dev);
@@ -503,8 +503,6 @@ static int sun6i_isp_remove(struct platform_device *platform_dev)
sun6i_isp_v4l2_cleanup(isp_dev);
sun6i_isp_tables_cleanup(isp_dev);
sun6i_isp_resources_cleanup(isp_dev);
-
- return 0;
}
/*
@@ -540,7 +538,7 @@ MODULE_DEVICE_TABLE(of, sun6i_isp_of_match);
static struct platform_driver sun6i_isp_platform_driver = {
.probe = sun6i_isp_probe,
- .remove = sun6i_isp_remove,
+ .remove_new = sun6i_isp_remove,
.driver = {
.name = SUN6I_ISP_NAME,
.of_match_table = of_match_ptr(sun6i_isp_of_match),
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 17/24] staging: most: dim2: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (15 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 18/24] staging: nvec: " Uwe Kleine-König
` (7 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Parthiban Veerasooran, Christian Gromm, Greg Kroah-Hartman,
Davidlohr Bueso, Deepak R Varma
Cc: linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/most/dim2/dim2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c
index 7a5f80e637a0..0810e942c86a 100644
--- a/drivers/staging/most/dim2/dim2.c
+++ b/drivers/staging/most/dim2/dim2.c
@@ -906,13 +906,11 @@ static int dim2_probe(struct platform_device *pdev)
*
* Unregister the interface from mostcore
*/
-static int dim2_remove(struct platform_device *pdev)
+static void dim2_remove(struct platform_device *pdev)
{
struct dim2_hdm *dev = platform_get_drvdata(pdev);
most_deregister_interface(&dev->most_iface);
-
- return 0;
}
/* platform specific functions [[ */
@@ -1091,7 +1089,7 @@ MODULE_DEVICE_TABLE(of, dim2_of_match);
static struct platform_driver dim2_driver = {
.probe = dim2_probe,
- .remove = dim2_remove,
+ .remove_new = dim2_remove,
.driver = {
.name = "hdm_dim2",
.of_match_table = dim2_of_match,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 18/24] staging: nvec: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (16 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 17/24] staging: most: dim2: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 19/24] staging: nvec: nvec_kbd: " Uwe Kleine-König
` (6 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Marc Dietrich, Greg Kroah-Hartman
Cc: ac100, linux-tegra, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/nvec/nvec.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index b3f114cb00dc..2823cacde130 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -882,7 +882,7 @@ static int tegra_nvec_probe(struct platform_device *pdev)
return 0;
}
-static int tegra_nvec_remove(struct platform_device *pdev)
+static void tegra_nvec_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = platform_get_drvdata(pdev);
@@ -893,8 +893,6 @@ static int tegra_nvec_remove(struct platform_device *pdev)
cancel_work_sync(&nvec->tx_work);
/* FIXME: needs check whether nvec is responsible for power off */
pm_power_off = NULL;
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -942,7 +940,7 @@ MODULE_DEVICE_TABLE(of, nvidia_nvec_of_match);
static struct platform_driver nvec_device_driver = {
.probe = tegra_nvec_probe,
- .remove = tegra_nvec_remove,
+ .remove_new = tegra_nvec_remove,
.driver = {
.name = "nvec",
.pm = &nvec_pm_ops,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 19/24] staging: nvec: nvec_kbd: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (17 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 18/24] staging: nvec: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 20/24] staging: nvec_power: " Uwe Kleine-König
` (5 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Marc Dietrich, Greg Kroah-Hartman
Cc: ac100, linux-tegra, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/nvec/nvec_kbd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/nvec/nvec_kbd.c b/drivers/staging/nvec/nvec_kbd.c
index 386d619e3ee9..f9a1da952c0a 100644
--- a/drivers/staging/nvec/nvec_kbd.c
+++ b/drivers/staging/nvec/nvec_kbd.c
@@ -161,7 +161,7 @@ static int nvec_kbd_probe(struct platform_device *pdev)
return 0;
}
-static int nvec_kbd_remove(struct platform_device *pdev)
+static void nvec_kbd_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
char disable_kbd[] = { NVEC_KBD, DISABLE_KBD },
@@ -170,13 +170,11 @@ static int nvec_kbd_remove(struct platform_device *pdev)
nvec_write_async(nvec, uncnfg_wake_key_reporting, 3);
nvec_write_async(nvec, disable_kbd, 2);
nvec_unregister_notifier(nvec, &keys_dev.notifier);
-
- return 0;
}
static struct platform_driver nvec_kbd_driver = {
.probe = nvec_kbd_probe,
- .remove = nvec_kbd_remove,
+ .remove_new = nvec_kbd_remove,
.driver = {
.name = "nvec-kbd",
},
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 20/24] staging: nvec_power: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (18 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 19/24] staging: nvec: nvec_kbd: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 21/24] staging: nvec_ps2: " Uwe Kleine-König
` (4 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Marc Dietrich, Greg Kroah-Hartman
Cc: ac100, linux-tegra, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/nvec/nvec_power.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/nvec/nvec_power.c b/drivers/staging/nvec/nvec_power.c
index b1ef196e1cfe..9943b1fff190 100644
--- a/drivers/staging/nvec/nvec_power.c
+++ b/drivers/staging/nvec/nvec_power.c
@@ -416,7 +416,7 @@ static int nvec_power_probe(struct platform_device *pdev)
return PTR_ERR_OR_ZERO(*psy);
}
-static int nvec_power_remove(struct platform_device *pdev)
+static void nvec_power_remove(struct platform_device *pdev)
{
struct nvec_power *power = platform_get_drvdata(pdev);
@@ -429,13 +429,11 @@ static int nvec_power_remove(struct platform_device *pdev)
case BAT:
power_supply_unregister(nvec_bat_psy);
}
-
- return 0;
}
static struct platform_driver nvec_power_driver = {
.probe = nvec_power_probe,
- .remove = nvec_power_remove,
+ .remove_new = nvec_power_remove,
.driver = {
.name = "nvec-power",
}
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 21/24] staging: nvec_ps2: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (19 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 20/24] staging: nvec_power: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 22/24] staging: octeon: ethernet: " Uwe Kleine-König
` (3 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Marc Dietrich, Greg Kroah-Hartman
Cc: ac100, linux-tegra, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/nvec/nvec_ps2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
index 06041c7f7d4f..cb6d71b8dc83 100644
--- a/drivers/staging/nvec/nvec_ps2.c
+++ b/drivers/staging/nvec/nvec_ps2.c
@@ -125,7 +125,7 @@ static int nvec_mouse_probe(struct platform_device *pdev)
return 0;
}
-static int nvec_mouse_remove(struct platform_device *pdev)
+static void nvec_mouse_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
@@ -133,8 +133,6 @@ static int nvec_mouse_remove(struct platform_device *pdev)
ps2_stopstreaming(ps2_dev.ser_dev);
nvec_unregister_notifier(nvec, &ps2_dev.notifier);
serio_unregister_port(ps2_dev.ser_dev);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -166,7 +164,7 @@ static SIMPLE_DEV_PM_OPS(nvec_mouse_pm_ops, nvec_mouse_suspend,
static struct platform_driver nvec_mouse_driver = {
.probe = nvec_mouse_probe,
- .remove = nvec_mouse_remove,
+ .remove_new = nvec_mouse_remove,
.driver = {
.name = "nvec-mouse",
.pm = &nvec_mouse_pm_ops,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 22/24] staging: octeon: ethernet: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (20 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 21/24] staging: nvec_ps2: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 23/24] staging: vc04_services: bcm2835-camera: " Uwe Kleine-König
` (2 subsequent siblings)
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/staging/octeon/ethernet.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index f662739137b5..9eee28f2940c 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -924,7 +924,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
return 0;
}
-static int cvm_oct_remove(struct platform_device *pdev)
+static void cvm_oct_remove(struct platform_device *pdev)
{
int port;
@@ -965,7 +965,6 @@ static int cvm_oct_remove(struct platform_device *pdev)
if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
cvm_oct_mem_empty_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL,
CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 128);
- return 0;
}
static const struct of_device_id cvm_oct_match[] = {
@@ -978,7 +977,7 @@ MODULE_DEVICE_TABLE(of, cvm_oct_match);
static struct platform_driver cvm_oct_driver = {
.probe = cvm_oct_probe,
- .remove = cvm_oct_remove,
+ .remove_new = cvm_oct_remove,
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = cvm_oct_match,
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 23/24] staging: vc04_services: bcm2835-camera: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (21 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 22/24] staging: octeon: ethernet: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-04 2:26 ` Laurent Pinchart
2023-04-03 15:40 ` [PATCH 24/24] staging: vc04_services: vchiq_arm: " Uwe Kleine-König
2023-04-03 19:50 ` [PATCH 00/24] staging: " Greg Kroah-Hartman
24 siblings, 1 reply; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Umang Jain, Laurent Pinchart, Andy Shevchenko
Cc: Broadcom internal kernel review list, linux-staging,
linux-rpi-kernel, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
.../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index 4f81765912ea..346d00df815a 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1976,7 +1976,7 @@ static int bcm2835_mmal_probe(struct platform_device *pdev)
return ret;
}
-static int bcm2835_mmal_remove(struct platform_device *pdev)
+static void bcm2835_mmal_remove(struct platform_device *pdev)
{
int camera;
struct vchiq_mmal_instance *instance = gdev[0]->instance;
@@ -1986,13 +1986,11 @@ static int bcm2835_mmal_remove(struct platform_device *pdev)
gdev[camera] = NULL;
}
vchiq_mmal_finalise(instance);
-
- return 0;
}
static struct platform_driver bcm2835_camera_driver = {
.probe = bcm2835_mmal_probe,
- .remove = bcm2835_mmal_remove,
+ .remove_new = bcm2835_mmal_remove,
.driver = {
.name = "bcm2835-camera",
},
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* [PATCH 24/24] staging: vc04_services: vchiq_arm: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (22 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 23/24] staging: vc04_services: bcm2835-camera: " Uwe Kleine-König
@ 2023-04-03 15:40 ` Uwe Kleine-König
2023-04-03 19:50 ` [PATCH 00/24] staging: " Greg Kroah-Hartman
24 siblings, 0 replies; 39+ messages in thread
From: Uwe Kleine-König @ 2023-04-03 15:40 UTC (permalink / raw)
To: Florian Fainelli, Greg Kroah-Hartman, Umang Jain, Adrien Thierry,
Stefan Wahren, Fabio M. De Francesco, Phil Elwell, Jakob Koschel
Cc: Broadcom internal kernel review list, linux-rpi-kernel,
linux-arm-kernel, linux-staging, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index cddcd3c596c9..40dd62cf7399 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -1849,14 +1849,12 @@ static int vchiq_probe(struct platform_device *pdev)
return err;
}
-static int vchiq_remove(struct platform_device *pdev)
+static void vchiq_remove(struct platform_device *pdev)
{
platform_device_unregister(bcm2835_audio);
platform_device_unregister(bcm2835_camera);
vchiq_debugfs_deinit();
vchiq_deregister_chrdev();
-
- return 0;
}
static struct platform_driver vchiq_driver = {
@@ -1865,7 +1863,7 @@ static struct platform_driver vchiq_driver = {
.of_match_table = vchiq_of_match,
},
.probe = vchiq_probe,
- .remove = vchiq_remove,
+ .remove_new = vchiq_remove,
};
static int __init vchiq_driver_init(void)
--
2.39.2
^ permalink raw reply related [flat|nested] 39+ messages in thread
* Re: [PATCH 07/24] staging: media: atmel-sama7g5-isc: Convert to platform remove callback returning void
2023-04-03 15:39 ` [PATCH 07/24] staging: media: atmel-sama7g5-isc: " Uwe Kleine-König
@ 2023-04-03 16:23 ` Nicolas Ferre
0 siblings, 0 replies; 39+ messages in thread
From: Nicolas Ferre @ 2023-04-03 16:23 UTC (permalink / raw)
To: Uwe Kleine-König, Eugen Hristev, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Alexandre Belloni, Claudiu Beznea
Cc: linux-media, linux-staging, linux-arm-kernel, kernel
On 03/04/2023 at 17:39, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
> index 01ababdfcbd9..315bfc4ac4ff 100644
> --- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
> +++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c
> @@ -549,7 +549,7 @@ static int microchip_xisc_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int microchip_xisc_remove(struct platform_device *pdev)
> +static void microchip_xisc_remove(struct platform_device *pdev)
> {
> struct isc_device *isc = platform_get_drvdata(pdev);
>
> @@ -562,8 +562,6 @@ static int microchip_xisc_remove(struct platform_device *pdev)
> clk_disable_unprepare(isc->hclock);
>
> atmel_isc_clk_cleanup(isc);
> -
> - return 0;
> }
>
> static int __maybe_unused xisc_runtime_suspend(struct device *dev)
> @@ -601,7 +599,7 @@ MODULE_DEVICE_TABLE(of, microchip_xisc_of_match);
>
> static struct platform_driver microchip_xisc_driver = {
> .probe = microchip_xisc_probe,
> - .remove = microchip_xisc_remove,
> + .remove_new = microchip_xisc_remove,
> .driver = {
> .name = "microchip-sama7g5-xisc",
> .pm = µchip_xisc_dev_pm_ops,
> --
> 2.39.2
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 06/24] staging: media: atmel-sama5d2-isc: Convert to platform remove callback returning void
2023-04-03 15:39 ` [PATCH 06/24] staging: media: atmel-sama5d2-isc: " Uwe Kleine-König
@ 2023-04-03 16:24 ` Nicolas Ferre
0 siblings, 0 replies; 39+ messages in thread
From: Nicolas Ferre @ 2023-04-03 16:24 UTC (permalink / raw)
To: Uwe Kleine-König, Eugen Hristev, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Alexandre Belloni, Claudiu Beznea
Cc: linux-media, linux-staging, linux-arm-kernel, kernel
On 03/04/2023 at 17:39, Uwe Kleine-König wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Thanks. Best regards,
Nicolas
> ---
> drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
> index ba0614f981a2..cc744cea1d0e 100644
> --- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
> +++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c
> @@ -580,7 +580,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int atmel_isc_remove(struct platform_device *pdev)
> +static void atmel_isc_remove(struct platform_device *pdev)
> {
> struct isc_device *isc = platform_get_drvdata(pdev);
>
> @@ -594,8 +594,6 @@ static int atmel_isc_remove(struct platform_device *pdev)
> clk_disable_unprepare(isc->hclock);
>
> atmel_isc_clk_cleanup(isc);
> -
> - return 0;
> }
>
> static int __maybe_unused isc_runtime_suspend(struct device *dev)
> @@ -638,7 +636,7 @@ MODULE_DEVICE_TABLE(of, atmel_isc_of_match);
>
> static struct platform_driver atmel_isc_driver = {
> .probe = atmel_isc_probe,
> - .remove = atmel_isc_remove,
> + .remove_new = atmel_isc_remove,
> .driver = {
> .name = "atmel-sama5d2-isc",
> .pm = &atmel_isc_dev_pm_ops,
> --
> 2.39.2
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 00/24] staging: Convert to platform remove callback returning void
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
` (23 preceding siblings ...)
2023-04-03 15:40 ` [PATCH 24/24] staging: vc04_services: vchiq_arm: " Uwe Kleine-König
@ 2023-04-03 19:50 ` Greg Kroah-Hartman
24 siblings, 0 replies; 39+ messages in thread
From: Greg Kroah-Hartman @ 2023-04-03 19:50 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Deepak R Varma, Yuan Can, Simon Horman, Sven Van Asbroeck,
Vaibhav Hiremath, Johan Hovold, Alex Elder, Eugen Hristev,
Mauro Carvalho Chehab, Nicolas Ferre, Alexandre Belloni,
Claudiu Beznea, Steve Longerbeam, Philipp Zabel, Shawn Guo,
Sascha Hauer, Neil Armstrong, Kevin Hilman, Laurent Pinchart,
Ezequiel Garcia, Maxime Ripard, Paul Kocialkowski, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Parthiban Veerasooran,
Christian Gromm, Davidlohr Bueso, Marc Dietrich, Florian Fainelli,
Ray Jui, Scott Branden, Umang Jain, Andy Shevchenko,
Adrien Thierry, Stefan Wahren, Fabio M. De Francesco, Phil Elwell,
Jakob Koschel, linux-staging, kernel, greybus-dev, linux-media,
linux-arm-kernel, Fabio Estevam, NXP Linux Team, Jerome Brunet,
Martin Blumenstingl, linux-amlogic, linux-rockchip, linux-sunxi,
ac100, linux-tegra, Broadcom internal kernel review list,
linux-rpi-kernel
On Mon, Apr 03, 2023 at 05:39:50PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> this series adapts the platform drivers below drivers/staging to use the
> .remove_new() callback. Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver
> core doesn't (and cannot) cope for errors during remove. The only effect
> of a non-zero return value in .remove() is that the driver core emits a
> warning. The device is removed anyhow and an early return from .remove()
> usually yields a resource leak.
>
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
>
> All drivers in staging already return zero in their remove callback, so
> they can be trivially converted.
>
> The changes to the individual drivers are all orthogonal. If I need to
> resend some patches because of some review feedback, I'd like to only
> send the patches that actually needed changes, so please pick up the
> remaining patches that don't need changing to reduce the amount of mail.
Note, I can't take drivers/staging/media/ patches, those go through the
v4l maintainer's tree. So I've taken the non-media patches from this
series now.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 12/24] staging: media: meson: vdec: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 12/24] staging: media: meson: vdec: " Uwe Kleine-König
@ 2023-04-03 20:38 ` Martin Blumenstingl
0 siblings, 0 replies; 39+ messages in thread
From: Martin Blumenstingl @ 2023-04-03 20:38 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Neil Armstrong, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Kevin Hilman, Jerome Brunet, linux-media, linux-amlogic,
linux-staging, linux-arm-kernel, kernel
On Mon, Apr 3, 2023 at 5:40 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 13/24] staging: media: omap4iss: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 13/24] staging: media: omap4iss: " Uwe Kleine-König
@ 2023-04-04 2:25 ` Laurent Pinchart
0 siblings, 0 replies; 39+ messages in thread
From: Laurent Pinchart @ 2023-04-04 2:25 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media,
linux-staging, kernel
Hi Uwe,
Thank you for the patch.
On Mon, Apr 03, 2023 at 05:40:03PM +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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/staging/media/omap4iss/iss.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/omap4iss/iss.c b/drivers/staging/media/omap4iss/iss.c
> index fa2a36d829d3..0c4283bb48ad 100644
> --- a/drivers/staging/media/omap4iss/iss.c
> +++ b/drivers/staging/media/omap4iss/iss.c
> @@ -1323,15 +1323,13 @@ static int iss_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int iss_remove(struct platform_device *pdev)
> +static void iss_remove(struct platform_device *pdev)
> {
> struct iss_device *iss = platform_get_drvdata(pdev);
>
> iss_unregister_entities(iss);
> media_entity_enum_cleanup(&iss->crashed);
> iss_cleanup_modules(iss);
> -
> - return 0;
> }
>
> static const struct platform_device_id omap4iss_id_table[] = {
> @@ -1342,7 +1340,7 @@ MODULE_DEVICE_TABLE(platform, omap4iss_id_table);
>
> static struct platform_driver iss_driver = {
> .probe = iss_probe,
> - .remove = iss_remove,
> + .remove_new = iss_remove,
> .id_table = omap4iss_id_table,
> .driver = {
> .name = "omap4iss",
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 23/24] staging: vc04_services: bcm2835-camera: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 23/24] staging: vc04_services: bcm2835-camera: " Uwe Kleine-König
@ 2023-04-04 2:26 ` Laurent Pinchart
0 siblings, 0 replies; 39+ messages in thread
From: Laurent Pinchart @ 2023-04-04 2:26 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Greg Kroah-Hartman, Florian Fainelli, Ray Jui, Scott Branden,
Umang Jain, Andy Shevchenko, Broadcom internal kernel review list,
linux-staging, linux-rpi-kernel, linux-arm-kernel, kernel
Hi Uwe,
Thank you for the patch.
On Mon, Apr 03, 2023 at 05:40:13PM +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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index 4f81765912ea..346d00df815a 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -1976,7 +1976,7 @@ static int bcm2835_mmal_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int bcm2835_mmal_remove(struct platform_device *pdev)
> +static void bcm2835_mmal_remove(struct platform_device *pdev)
> {
> int camera;
> struct vchiq_mmal_instance *instance = gdev[0]->instance;
> @@ -1986,13 +1986,11 @@ static int bcm2835_mmal_remove(struct platform_device *pdev)
> gdev[camera] = NULL;
> }
> vchiq_mmal_finalise(instance);
> -
> - return 0;
> }
>
> static struct platform_driver bcm2835_camera_driver = {
> .probe = bcm2835_mmal_probe,
> - .remove = bcm2835_mmal_remove,
> + .remove_new = bcm2835_mmal_remove,
> .driver = {
> .name = "bcm2835-camera",
> },
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 08/24] staging: media: imx-media-csi: Convert to platform remove callback returning void
2023-04-03 15:39 ` [PATCH 08/24] staging: media: imx-media-csi: " Uwe Kleine-König
@ 2023-04-04 8:38 ` Philipp Zabel
0 siblings, 0 replies; 39+ messages in thread
From: Philipp Zabel @ 2023-04-04 8:38 UTC (permalink / raw)
To: Uwe Kleine-König, Steve Longerbeam, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
On Mo, 2023-04-03 at 17:39 +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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 09/24] staging: media: imx-media-dev: Convert to platform remove callback returning void
2023-04-03 15:39 ` [PATCH 09/24] staging: media: imx-media-dev: " Uwe Kleine-König
@ 2023-04-04 8:38 ` Philipp Zabel
0 siblings, 0 replies; 39+ messages in thread
From: Philipp Zabel @ 2023-04-04 8:38 UTC (permalink / raw)
To: Uwe Kleine-König, Steve Longerbeam, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
On Mo, 2023-04-03 at 17:39 +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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 10/24] staging: media: imx6-mipi-csi2: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 10/24] staging: media: imx6-mipi-csi2: " Uwe Kleine-König
@ 2023-04-04 8:38 ` Philipp Zabel
0 siblings, 0 replies; 39+ messages in thread
From: Philipp Zabel @ 2023-04-04 8:38 UTC (permalink / raw)
To: Uwe Kleine-König, Steve Longerbeam, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
On Mo, 2023-04-03 at 17:40 +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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 11/24] staging: media: imx8mq-mipi-csi2: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 11/24] staging: media: imx8mq-mipi-csi2: " Uwe Kleine-König
@ 2023-04-04 8:38 ` Philipp Zabel
0 siblings, 0 replies; 39+ messages in thread
From: Philipp Zabel @ 2023-04-04 8:38 UTC (permalink / raw)
To: Uwe Kleine-König, Steve Longerbeam, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, linux-staging,
linux-arm-kernel, kernel
On Mo, 2023-04-03 at 17:40 +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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 15/24] staging: media: sunxi: cedrus: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
@ 2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:53 ` Jernej Škrabec
1 sibling, 0 replies; 39+ messages in thread
From: Paul Kocialkowski @ 2023-04-04 8:47 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Maxime Ripard, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-media,
linux-staging, linux-arm-kernel, linux-sunxi, kernel
[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]
Hi,
On Mon 03 Apr 23, 17:40, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Thanks,
Paul
> ---
> drivers/staging/media/sunxi/cedrus/cedrus.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
> index a43d5ff66716..3c62376c3e94 100644
> --- a/drivers/staging/media/sunxi/cedrus/cedrus.c
> +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
> @@ -543,7 +543,7 @@ static int cedrus_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int cedrus_remove(struct platform_device *pdev)
> +static void cedrus_remove(struct platform_device *pdev)
> {
> struct cedrus_dev *dev = platform_get_drvdata(pdev);
>
> @@ -558,8 +558,6 @@ static int cedrus_remove(struct platform_device *pdev)
> v4l2_device_unregister(&dev->v4l2_dev);
>
> cedrus_hw_remove(dev);
> -
> - return 0;
> }
>
> static const struct cedrus_variant sun4i_a10_cedrus_variant = {
> @@ -706,7 +704,7 @@ static const struct dev_pm_ops cedrus_dev_pm_ops = {
>
> static struct platform_driver cedrus_driver = {
> .probe = cedrus_probe,
> - .remove = cedrus_remove,
> + .remove_new = cedrus_remove,
> .driver = {
> .name = CEDRUS_NAME,
> .of_match_table = of_match_ptr(cedrus_dt_match),
> --
> 2.39.2
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 16/24] staging: media: sun6i-isp: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
@ 2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:54 ` Jernej Škrabec
1 sibling, 0 replies; 39+ messages in thread
From: Paul Kocialkowski @ 2023-04-04 8:47 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, linux-media, linux-staging,
linux-arm-kernel, linux-sunxi, kernel
[-- Attachment #1: Type: text/plain, Size: 2259 bytes --]
Hi,
On Mon 03 Apr 23, 17:40, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Thanks,
Paul
> ---
> drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
> index 7b7947509b69..0dc75adbd9d8 100644
> --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
> +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp.c
> @@ -493,7 +493,7 @@ static int sun6i_isp_probe(struct platform_device *platform_dev)
> return ret;
> }
>
> -static int sun6i_isp_remove(struct platform_device *platform_dev)
> +static void sun6i_isp_remove(struct platform_device *platform_dev)
> {
> struct sun6i_isp_device *isp_dev = platform_get_drvdata(platform_dev);
>
> @@ -503,8 +503,6 @@ static int sun6i_isp_remove(struct platform_device *platform_dev)
> sun6i_isp_v4l2_cleanup(isp_dev);
> sun6i_isp_tables_cleanup(isp_dev);
> sun6i_isp_resources_cleanup(isp_dev);
> -
> - return 0;
> }
>
> /*
> @@ -540,7 +538,7 @@ MODULE_DEVICE_TABLE(of, sun6i_isp_of_match);
>
> static struct platform_driver sun6i_isp_platform_driver = {
> .probe = sun6i_isp_probe,
> - .remove = sun6i_isp_remove,
> + .remove_new = sun6i_isp_remove,
> .driver = {
> .name = SUN6I_ISP_NAME,
> .of_match_table = of_match_ptr(sun6i_isp_of_match),
> --
> 2.39.2
>
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 15/24] staging: media: sunxi: cedrus: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
@ 2023-04-04 16:53 ` Jernej Škrabec
1 sibling, 0 replies; 39+ messages in thread
From: Jernej Škrabec @ 2023-04-04 16:53 UTC (permalink / raw)
To: Maxime Ripard, Paul Kocialkowski, Mauro Carvalho Chehab,
Greg Kroah-Hartman, Chen-Yu Tsai, Samuel Holland,
Uwe Kleine-König
Cc: linux-media, linux-staging, linux-arm-kernel, linux-sunxi, kernel
Dne ponedeljek, 03. april 2023 ob 17:40:05 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply [flat|nested] 39+ messages in thread
* Re: [PATCH 16/24] staging: media: sun6i-isp: Convert to platform remove callback returning void
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
@ 2023-04-04 16:54 ` Jernej Škrabec
1 sibling, 0 replies; 39+ messages in thread
From: Jernej Škrabec @ 2023-04-04 16:54 UTC (permalink / raw)
To: Paul Kocialkowski, Mauro Carvalho Chehab, Greg Kroah-Hartman,
Chen-Yu Tsai, Samuel Holland, Uwe Kleine-König
Cc: linux-media, linux-staging, linux-arm-kernel, linux-sunxi, kernel
Dne ponedeljek, 03. april 2023 ob 17:40: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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply [flat|nested] 39+ messages in thread
end of thread, other threads:[~2023-04-04 16:54 UTC | newest]
Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03 15:39 [PATCH 00/24] staging: Convert to platform remove callback returning void Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 01/24] staging: axis-fifo: " Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 02/24] staging: emxx_udc: " Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 03/24] staging: fieldbus: arcx-anybus: " Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 04/24] staging: greybus: arche-apb-ctrl: " Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 05/24] staging: greybus: arche: " Uwe Kleine-König
2023-04-03 15:39 ` [PATCH 06/24] staging: media: atmel-sama5d2-isc: " Uwe Kleine-König
2023-04-03 16:24 ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 07/24] staging: media: atmel-sama7g5-isc: " Uwe Kleine-König
2023-04-03 16:23 ` Nicolas Ferre
2023-04-03 15:39 ` [PATCH 08/24] staging: media: imx-media-csi: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:39 ` [PATCH 09/24] staging: media: imx-media-dev: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 10/24] staging: media: imx6-mipi-csi2: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 11/24] staging: media: imx8mq-mipi-csi2: " Uwe Kleine-König
2023-04-04 8:38 ` Philipp Zabel
2023-04-03 15:40 ` [PATCH 12/24] staging: media: meson: vdec: " Uwe Kleine-König
2023-04-03 20:38 ` Martin Blumenstingl
2023-04-03 15:40 ` [PATCH 13/24] staging: media: omap4iss: " Uwe Kleine-König
2023-04-04 2:25 ` Laurent Pinchart
2023-04-03 15:40 ` [PATCH 14/24] staging: media: rkvdec: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 15/24] staging: media: sunxi: cedrus: " Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:53 ` Jernej Škrabec
2023-04-03 15:40 ` [PATCH 16/24] staging: media: sun6i-isp: " Uwe Kleine-König
2023-04-04 8:47 ` Paul Kocialkowski
2023-04-04 16:54 ` Jernej Škrabec
2023-04-03 15:40 ` [PATCH 17/24] staging: most: dim2: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 18/24] staging: nvec: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 19/24] staging: nvec: nvec_kbd: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 20/24] staging: nvec_power: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 21/24] staging: nvec_ps2: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 22/24] staging: octeon: ethernet: " Uwe Kleine-König
2023-04-03 15:40 ` [PATCH 23/24] staging: vc04_services: bcm2835-camera: " Uwe Kleine-König
2023-04-04 2:26 ` Laurent Pinchart
2023-04-03 15:40 ` [PATCH 24/24] staging: vc04_services: vchiq_arm: " Uwe Kleine-König
2023-04-03 19:50 ` [PATCH 00/24] staging: " Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).