* [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-04-03 20:39 ` Martin Blumenstingl
2023-03-26 14:30 ` [PATCH 005/117] media: ao-cec: " Uwe Kleine-König
` (44 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Neil Armstrong, Hans Verkuil, Mauro Carvalho Chehab, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-media, linux-amlogic,
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/media/cec/platform/meson/ao-cec-g12a.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/cec/platform/meson/ao-cec-g12a.c b/drivers/media/cec/platform/meson/ao-cec-g12a.c
index 68fe6d6a8178..51294b9b6cd5 100644
--- a/drivers/media/cec/platform/meson/ao-cec-g12a.c
+++ b/drivers/media/cec/platform/meson/ao-cec-g12a.c
@@ -744,7 +744,7 @@ static int meson_ao_cec_g12a_probe(struct platform_device *pdev)
return ret;
}
-static int meson_ao_cec_g12a_remove(struct platform_device *pdev)
+static void meson_ao_cec_g12a_remove(struct platform_device *pdev)
{
struct meson_ao_cec_g12a_device *ao_cec = platform_get_drvdata(pdev);
@@ -753,8 +753,6 @@ static int meson_ao_cec_g12a_remove(struct platform_device *pdev)
cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap);
cec_unregister_adapter(ao_cec->adap);
-
- return 0;
}
static const struct meson_ao_cec_g12a_data ao_cec_g12a_data = {
@@ -780,7 +778,7 @@ MODULE_DEVICE_TABLE(of, meson_ao_cec_g12a_of_match);
static struct platform_driver meson_ao_cec_g12a_driver = {
.probe = meson_ao_cec_g12a_probe,
- .remove = meson_ao_cec_g12a_remove,
+ .remove_new = meson_ao_cec_g12a_remove,
.driver = {
.name = "meson-ao-cec-g12a",
.of_match_table = of_match_ptr(meson_ao_cec_g12a_of_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void
2023-03-26 14:30 ` [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-04-03 20:39 ` Martin Blumenstingl
0 siblings, 0 replies; 62+ messages in thread
From: Martin Blumenstingl @ 2023-04-03 20:39 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Neil Armstrong, Hans Verkuil, Mauro Carvalho Chehab, Kevin Hilman,
Jerome Brunet, linux-media, linux-amlogic, linux-arm-kernel,
kernel
On Sun, Mar 26, 2023 at 4:32 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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 005/117] media: ao-cec: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
2023-03-26 14:30 ` [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-04-03 20:39 ` Martin Blumenstingl
2023-03-26 14:30 ` [PATCH 009/117] media: stm32-cec: " Uwe Kleine-König
` (43 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Neil Armstrong, Hans Verkuil, Mauro Carvalho Chehab, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-media, linux-amlogic,
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/media/cec/platform/meson/ao-cec.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/cec/platform/meson/ao-cec.c b/drivers/media/cec/platform/meson/ao-cec.c
index 6b440f0635d9..f6f51a34f7bd 100644
--- a/drivers/media/cec/platform/meson/ao-cec.c
+++ b/drivers/media/cec/platform/meson/ao-cec.c
@@ -696,7 +696,7 @@ static int meson_ao_cec_probe(struct platform_device *pdev)
return ret;
}
-static int meson_ao_cec_remove(struct platform_device *pdev)
+static void meson_ao_cec_remove(struct platform_device *pdev)
{
struct meson_ao_cec_device *ao_cec = platform_get_drvdata(pdev);
@@ -704,8 +704,6 @@ static int meson_ao_cec_remove(struct platform_device *pdev)
cec_notifier_cec_adap_unregister(ao_cec->notify, ao_cec->adap);
cec_unregister_adapter(ao_cec->adap);
-
- return 0;
}
static const struct of_device_id meson_ao_cec_of_match[] = {
@@ -716,7 +714,7 @@ MODULE_DEVICE_TABLE(of, meson_ao_cec_of_match);
static struct platform_driver meson_ao_cec_driver = {
.probe = meson_ao_cec_probe,
- .remove = meson_ao_cec_remove,
+ .remove_new = meson_ao_cec_remove,
.driver = {
.name = "meson-ao-cec",
.of_match_table = of_match_ptr(meson_ao_cec_of_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 005/117] media: ao-cec: Convert to platform remove callback returning void
2023-03-26 14:30 ` [PATCH 005/117] media: ao-cec: " Uwe Kleine-König
@ 2023-04-03 20:39 ` Martin Blumenstingl
0 siblings, 0 replies; 62+ messages in thread
From: Martin Blumenstingl @ 2023-04-03 20:39 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Neil Armstrong, Hans Verkuil, Mauro Carvalho Chehab, Kevin Hilman,
Jerome Brunet, linux-media, linux-amlogic, linux-arm-kernel,
kernel
On Sun, Mar 26, 2023 at 4:32 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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 009/117] media: stm32-cec: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
2023-03-26 14:30 ` [PATCH 004/117] media: ao-cec-g12a: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 005/117] media: ao-cec: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 014/117] media: ge2d: " Uwe Kleine-König
` (42 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Hans Verkuil, Mauro Carvalho Chehab, Maxime Coquelin,
Alexandre Torgue, Uwe Kleine-König, Sean Young, Sakari Ailus,
Ricardo Ribalda, Laurent Pinchart, Yang Yingliang
Cc: linux-media, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/media/cec/platform/stm32/stm32-cec.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/cec/platform/stm32/stm32-cec.c b/drivers/media/cec/platform/stm32/stm32-cec.c
index 7b2db46a5722..ada3d153362a 100644
--- a/drivers/media/cec/platform/stm32/stm32-cec.c
+++ b/drivers/media/cec/platform/stm32/stm32-cec.c
@@ -344,7 +344,7 @@ static int stm32_cec_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_cec_remove(struct platform_device *pdev)
+static void stm32_cec_remove(struct platform_device *pdev)
{
struct stm32_cec *cec = platform_get_drvdata(pdev);
@@ -352,8 +352,6 @@ static int stm32_cec_remove(struct platform_device *pdev)
clk_unprepare(cec->clk_hdmi_cec);
cec_unregister_adapter(cec->adap);
-
- return 0;
}
static const struct of_device_id stm32_cec_of_match[] = {
@@ -364,7 +362,7 @@ MODULE_DEVICE_TABLE(of, stm32_cec_of_match);
static struct platform_driver stm32_cec_driver = {
.probe = stm32_cec_probe,
- .remove = stm32_cec_remove,
+ .remove_new = stm32_cec_remove,
.driver = {
.name = CEC_NAME,
.of_match_table = stm32_cec_of_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 014/117] media: ge2d: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (2 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 009/117] media: stm32-cec: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-04-03 20:40 ` Martin Blumenstingl
2023-03-26 14:30 ` [PATCH 017/117] media: aspeed-video: " Uwe Kleine-König
` (41 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Neil Armstrong, Mauro Carvalho Chehab, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-media, linux-amlogic,
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/media/platform/amlogic/meson-ge2d/ge2d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c
index 142d421a8d76..09409908ba5d 100644
--- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c
+++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c
@@ -1024,7 +1024,7 @@ static int ge2d_probe(struct platform_device *pdev)
return ret;
}
-static int ge2d_remove(struct platform_device *pdev)
+static void ge2d_remove(struct platform_device *pdev)
{
struct meson_ge2d *ge2d = platform_get_drvdata(pdev);
@@ -1032,8 +1032,6 @@ static int ge2d_remove(struct platform_device *pdev)
v4l2_m2m_release(ge2d->m2m_dev);
v4l2_device_unregister(&ge2d->v4l2_dev);
clk_disable_unprepare(ge2d->clk);
-
- return 0;
}
static const struct of_device_id meson_ge2d_match[] = {
@@ -1047,7 +1045,7 @@ MODULE_DEVICE_TABLE(of, meson_ge2d_match);
static struct platform_driver ge2d_drv = {
.probe = ge2d_probe,
- .remove = ge2d_remove,
+ .remove_new = ge2d_remove,
.driver = {
.name = "meson-ge2d",
.of_match_table = meson_ge2d_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 014/117] media: ge2d: Convert to platform remove callback returning void
2023-03-26 14:30 ` [PATCH 014/117] media: ge2d: " Uwe Kleine-König
@ 2023-04-03 20:40 ` Martin Blumenstingl
0 siblings, 0 replies; 62+ messages in thread
From: Martin Blumenstingl @ 2023-04-03 20:40 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Neil Armstrong, Mauro Carvalho Chehab, Kevin Hilman,
Jerome Brunet, linux-media, linux-amlogic, linux-arm-kernel,
kernel
On Sun, Mar 26, 2023 at 4:32 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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 017/117] media: aspeed-video: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (3 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 014/117] media: ge2d: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 018/117] media: atmel-isi: " Uwe Kleine-König
` (40 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Eddie James, Mauro Carvalho Chehab, Joel Stanley
Cc: Andrew Jeffery, linux-media, openbmc, linux-arm-kernel,
linux-aspeed, 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/media/platform/aspeed/aspeed-video.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c
index 794d4dc3a654..374eb7781936 100644
--- a/drivers/media/platform/aspeed/aspeed-video.c
+++ b/drivers/media/platform/aspeed/aspeed-video.c
@@ -2206,7 +2206,7 @@ static int aspeed_video_probe(struct platform_device *pdev)
return 0;
}
-static int aspeed_video_remove(struct platform_device *pdev)
+static void aspeed_video_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
@@ -2228,8 +2228,6 @@ static int aspeed_video_remove(struct platform_device *pdev)
aspeed_video_free_buf(video, &video->jpeg);
of_reserved_mem_device_release(dev);
-
- return 0;
}
static struct platform_driver aspeed_video_driver = {
@@ -2238,7 +2236,7 @@ static struct platform_driver aspeed_video_driver = {
.of_match_table = aspeed_video_of_match,
},
.probe = aspeed_video_probe,
- .remove = aspeed_video_remove,
+ .remove_new = aspeed_video_remove,
};
module_platform_driver(aspeed_video_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 018/117] media: atmel-isi: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (4 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 017/117] media: aspeed-video: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-04-03 11:32 ` Nicolas Ferre
2023-03-26 14:30 ` [PATCH 026/117] media: mtk_jpeg_core: " Uwe Kleine-König
` (39 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Eugen Hristev, Mauro Carvalho Chehab, Nicolas Ferre,
Alexandre Belloni, Claudiu Beznea
Cc: linux-media, 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/media/platform/atmel/atmel-isi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 4d15814e4481..b063f980f9e0 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -1317,7 +1317,7 @@ static int atmel_isi_probe(struct platform_device *pdev)
return ret;
}
-static int atmel_isi_remove(struct platform_device *pdev)
+static void atmel_isi_remove(struct platform_device *pdev)
{
struct atmel_isi *isi = platform_get_drvdata(pdev);
@@ -1329,8 +1329,6 @@ static int atmel_isi_remove(struct platform_device *pdev)
v4l2_async_nf_unregister(&isi->notifier);
v4l2_async_nf_cleanup(&isi->notifier);
v4l2_device_unregister(&isi->v4l2_dev);
-
- return 0;
}
#ifdef CONFIG_PM
@@ -1368,7 +1366,7 @@ static struct platform_driver atmel_isi_driver = {
.pm = &atmel_isi_dev_pm_ops,
},
.probe = atmel_isi_probe,
- .remove = atmel_isi_remove,
+ .remove_new = atmel_isi_remove,
};
module_platform_driver(atmel_isi_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 018/117] media: atmel-isi: Convert to platform remove callback returning void
2023-03-26 14:30 ` [PATCH 018/117] media: atmel-isi: " Uwe Kleine-König
@ 2023-04-03 11:32 ` Nicolas Ferre
0 siblings, 0 replies; 62+ messages in thread
From: Nicolas Ferre @ 2023-04-03 11:32 UTC (permalink / raw)
To: Uwe Kleine-König, Eugen Hristev, Mauro Carvalho Chehab,
Alexandre Belloni, Claudiu Beznea, Balamanikandan Gunasundar
Cc: linux-media, linux-arm-kernel, kernel
On 26/03/2023 at 16:30, 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/media/platform/atmel/atmel-isi.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
> index 4d15814e4481..b063f980f9e0 100644
> --- a/drivers/media/platform/atmel/atmel-isi.c
> +++ b/drivers/media/platform/atmel/atmel-isi.c
> @@ -1317,7 +1317,7 @@ static int atmel_isi_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int atmel_isi_remove(struct platform_device *pdev)
> +static void atmel_isi_remove(struct platform_device *pdev)
> {
> struct atmel_isi *isi = platform_get_drvdata(pdev);
>
> @@ -1329,8 +1329,6 @@ static int atmel_isi_remove(struct platform_device *pdev)
> v4l2_async_nf_unregister(&isi->notifier);
> v4l2_async_nf_cleanup(&isi->notifier);
> v4l2_device_unregister(&isi->v4l2_dev);
> -
> - return 0;
> }
>
> #ifdef CONFIG_PM
> @@ -1368,7 +1366,7 @@ static struct platform_driver atmel_isi_driver = {
> .pm = &atmel_isi_dev_pm_ops,
> },
> .probe = atmel_isi_probe,
> - .remove = atmel_isi_remove,
> + .remove_new = atmel_isi_remove,
> };
>
> module_platform_driver(atmel_isi_driver);
> --
> 2.39.2
>
--
Nicolas Ferre
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 026/117] media: mtk_jpeg_core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (5 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 018/117] media: atmel-isi: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 027/117] media: mtk_mdp_core: " Uwe Kleine-König
` (38 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Bin Liu, Mauro Carvalho Chehab, Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index 969516a940ba..e043da5ea325 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1790,7 +1790,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_jpeg_remove(struct platform_device *pdev)
+static void mtk_jpeg_remove(struct platform_device *pdev)
{
struct mtk_jpeg_dev *jpeg = platform_get_drvdata(pdev);
@@ -1798,8 +1798,6 @@ static int mtk_jpeg_remove(struct platform_device *pdev)
video_unregister_device(jpeg->vdev);
v4l2_m2m_release(jpeg->m2m_dev);
v4l2_device_unregister(&jpeg->v4l2_dev);
-
- return 0;
}
static __maybe_unused int mtk_jpeg_pm_suspend(struct device *dev)
@@ -1928,7 +1926,7 @@ MODULE_DEVICE_TABLE(of, mtk_jpeg_match);
static struct platform_driver mtk_jpeg_driver = {
.probe = mtk_jpeg_probe,
- .remove = mtk_jpeg_remove,
+ .remove_new = mtk_jpeg_remove,
.driver = {
.name = MTK_JPEG_NAME,
.of_match_table = of_match_ptr(mtk_jpeg_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 027/117] media: mtk_mdp_core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (6 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 026/117] media: mtk_jpeg_core: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 028/117] media: mtk-mdp3-core: " Uwe Kleine-König
` (37 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Minghsiu Tsai, Houlong Wei, Andrew-CT Chen, Mauro Carvalho Chehab,
Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/platform/mediatek/mdp/mtk_mdp_core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
index d83c4964eaf9..77e310e588e5 100644
--- a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
+++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
@@ -235,7 +235,7 @@ static int mtk_mdp_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_mdp_remove(struct platform_device *pdev)
+static void mtk_mdp_remove(struct platform_device *pdev)
{
struct mtk_mdp_dev *mdp = platform_get_drvdata(pdev);
struct mtk_mdp_comp *comp, *comp_temp;
@@ -255,7 +255,6 @@ static int mtk_mdp_remove(struct platform_device *pdev)
}
dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name);
- return 0;
}
static int __maybe_unused mtk_mdp_pm_suspend(struct device *dev)
@@ -299,7 +298,7 @@ static const struct dev_pm_ops mtk_mdp_pm_ops = {
static struct platform_driver mtk_mdp_driver = {
.probe = mtk_mdp_probe,
- .remove = mtk_mdp_remove,
+ .remove_new = mtk_mdp_remove,
.driver = {
.name = MTK_MDP_MODULE_NAME,
.pm = &mtk_mdp_pm_ops,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 028/117] media: mtk-mdp3-core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (7 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 027/117] media: mtk_mdp_core: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 029/117] media: mtk_vcodec_dec_drv: " Uwe Kleine-König
` (36 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Matthias Brugger, Hans Verkuil, Moudy Ho,
Qiheng Lin, Uwe Kleine-König
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/platform/mediatek/mdp3/mtk-mdp3-core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
index 97edcd9d1c81..041bcad675da 100644
--- a/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
+++ b/drivers/media/platform/mediatek/mdp3/mtk-mdp3-core.c
@@ -298,14 +298,13 @@ static int mdp_probe(struct platform_device *pdev)
return ret;
}
-static int mdp_remove(struct platform_device *pdev)
+static void mdp_remove(struct platform_device *pdev)
{
struct mdp_dev *mdp = platform_get_drvdata(pdev);
v4l2_device_unregister(&mdp->v4l2_dev);
dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name);
- return 0;
}
static int __maybe_unused mdp_suspend(struct device *dev)
@@ -345,7 +344,7 @@ static const struct dev_pm_ops mdp_pm_ops = {
static struct platform_driver mdp_driver = {
.probe = mdp_probe,
- .remove = mdp_remove,
+ .remove_new = mdp_remove,
.driver = {
.name = MDP_MODULE_NAME,
.pm = &mdp_pm_ops,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 029/117] media: mtk_vcodec_dec_drv: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (8 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 028/117] media: mtk-mdp3-core: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 030/117] media: mtk_vcodec_enc_drv: " Uwe Kleine-König
` (35 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
index 174a6eec2f54..2fa5c5e6607c 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
@@ -487,7 +487,7 @@ static const struct of_device_id mtk_vcodec_match[] = {
MODULE_DEVICE_TABLE(of, mtk_vcodec_match);
-static int mtk_vcodec_dec_remove(struct platform_device *pdev)
+static void mtk_vcodec_dec_remove(struct platform_device *pdev)
{
struct mtk_vcodec_dev *dev = platform_get_drvdata(pdev);
@@ -509,12 +509,11 @@ static int mtk_vcodec_dec_remove(struct platform_device *pdev)
if (!dev->vdec_pdata->is_subdev_supported)
pm_runtime_disable(dev->pm.dev);
mtk_vcodec_fw_release(dev->fw_handler);
- return 0;
}
static struct platform_driver mtk_vcodec_dec_driver = {
.probe = mtk_vcodec_probe,
- .remove = mtk_vcodec_dec_remove,
+ .remove_new = mtk_vcodec_dec_remove,
.driver = {
.name = MTK_VCODEC_DEC_NAME,
.of_match_table = mtk_vcodec_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 030/117] media: mtk_vcodec_enc_drv: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (9 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 029/117] media: mtk_vcodec_dec_drv: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:30 ` [PATCH 031/117] media: mtk_vpu: " Uwe Kleine-König
` (34 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Mauro Carvalho Chehab,
Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
index 9095186d5495..cd0d5da8195a 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
@@ -451,7 +451,7 @@ static const struct of_device_id mtk_vcodec_enc_match[] = {
};
MODULE_DEVICE_TABLE(of, mtk_vcodec_enc_match);
-static int mtk_vcodec_enc_remove(struct platform_device *pdev)
+static void mtk_vcodec_enc_remove(struct platform_device *pdev)
{
struct mtk_vcodec_dev *dev = platform_get_drvdata(pdev);
@@ -466,12 +466,11 @@ static int mtk_vcodec_enc_remove(struct platform_device *pdev)
v4l2_device_unregister(&dev->v4l2_dev);
pm_runtime_disable(dev->pm.dev);
mtk_vcodec_fw_release(dev->fw_handler);
- return 0;
}
static struct platform_driver mtk_vcodec_enc_driver = {
.probe = mtk_vcodec_probe,
- .remove = mtk_vcodec_enc_remove,
+ .remove_new = mtk_vcodec_enc_remove,
.driver = {
.name = MTK_VCODEC_ENC_NAME,
.of_match_table = mtk_vcodec_enc_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 031/117] media: mtk_vpu: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (10 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 030/117] media: mtk_vcodec_enc_drv: " Uwe Kleine-König
@ 2023-03-26 14:30 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 037/117] media: mxc-jpeg: " Uwe Kleine-König
` (33 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
To: Tiffany Lin, Andrew-CT Chen, Yunfei Dong, Minghsiu Tsai,
Houlong Wei, Mauro Carvalho Chehab, Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/platform/mediatek/vpu/mtk_vpu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/mediatek/vpu/mtk_vpu.c b/drivers/media/platform/mediatek/vpu/mtk_vpu.c
index 47b684b92f81..5e2bc286f168 100644
--- a/drivers/media/platform/mediatek/vpu/mtk_vpu.c
+++ b/drivers/media/platform/mediatek/vpu/mtk_vpu.c
@@ -953,7 +953,7 @@ static const struct of_device_id mtk_vpu_match[] = {
};
MODULE_DEVICE_TABLE(of, mtk_vpu_match);
-static int mtk_vpu_remove(struct platform_device *pdev)
+static void mtk_vpu_remove(struct platform_device *pdev)
{
struct mtk_vpu *vpu = platform_get_drvdata(pdev);
@@ -966,8 +966,6 @@ static int mtk_vpu_remove(struct platform_device *pdev)
vpu_free_ext_mem(vpu, D_FW);
mutex_destroy(&vpu->vpu_mutex);
clk_unprepare(vpu->clk);
-
- return 0;
}
static int mtk_vpu_suspend(struct device *dev)
@@ -1040,7 +1038,7 @@ static const struct dev_pm_ops mtk_vpu_pm = {
static struct platform_driver mtk_vpu_driver = {
.probe = mtk_vpu_probe,
- .remove = mtk_vpu_remove,
+ .remove_new = mtk_vpu_remove,
.driver = {
.name = "mtk_vpu",
.pm = &mtk_vpu_pm,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 037/117] media: mxc-jpeg: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (11 preceding siblings ...)
2023-03-26 14:30 ` [PATCH 031/117] media: mtk_vpu: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 038/117] media: imx-mipi-csis: " Uwe Kleine-König
` (32 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Mirela Rabulea, Mauro Carvalho Chehab, Shawn Guo, Sascha Hauer
Cc: NXP Linux Team, Fabio Estevam, linux-media, 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/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
index f085f14d676a..4dd404d69c4e 100644
--- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
+++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
@@ -2622,7 +2622,7 @@ static const struct dev_pm_ops mxc_jpeg_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(mxc_jpeg_suspend, mxc_jpeg_resume)
};
-static int mxc_jpeg_remove(struct platform_device *pdev)
+static void mxc_jpeg_remove(struct platform_device *pdev)
{
unsigned int slot;
struct mxc_jpeg_dev *jpeg = platform_get_drvdata(pdev);
@@ -2635,15 +2635,13 @@ static int mxc_jpeg_remove(struct platform_device *pdev)
v4l2_m2m_release(jpeg->m2m_dev);
v4l2_device_unregister(&jpeg->v4l2_dev);
mxc_jpeg_detach_pm_domains(jpeg);
-
- return 0;
}
MODULE_DEVICE_TABLE(of, mxc_jpeg_match);
static struct platform_driver mxc_jpeg_driver = {
.probe = mxc_jpeg_probe,
- .remove = mxc_jpeg_remove,
+ .remove_new = mxc_jpeg_remove,
.driver = {
.name = "mxc-jpeg",
.of_match_table = mxc_jpeg_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 038/117] media: imx-mipi-csis: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (12 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 037/117] media: mxc-jpeg: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 039/117] media: imx-pxp: " Uwe Kleine-König
` (31 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Rui Miguel Silva, Laurent Pinchart, Mauro Carvalho Chehab,
Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, 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/media/platform/nxp/imx-mipi-csis.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
index be2768a47995..05d52762e792 100644
--- a/drivers/media/platform/nxp/imx-mipi-csis.c
+++ b/drivers/media/platform/nxp/imx-mipi-csis.c
@@ -1503,7 +1503,7 @@ static int mipi_csis_probe(struct platform_device *pdev)
return ret;
}
-static int mipi_csis_remove(struct platform_device *pdev)
+static void mipi_csis_remove(struct platform_device *pdev)
{
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct mipi_csis_device *csis = sd_to_mipi_csis_device(sd);
@@ -1520,8 +1520,6 @@ static int mipi_csis_remove(struct platform_device *pdev)
media_entity_cleanup(&csis->sd.entity);
fwnode_handle_put(csis->sd.fwnode);
pm_runtime_set_suspended(&pdev->dev);
-
- return 0;
}
static const struct of_device_id mipi_csis_of_match[] = {
@@ -1544,7 +1542,7 @@ MODULE_DEVICE_TABLE(of, mipi_csis_of_match);
static struct platform_driver mipi_csis_driver = {
.probe = mipi_csis_probe,
- .remove = mipi_csis_remove,
+ .remove_new = mipi_csis_remove,
.driver = {
.of_match_table = mipi_csis_of_match,
.name = CSIS_DRIVER_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 039/117] media: imx-pxp: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (13 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 038/117] media: imx-mipi-csis: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 040/117] media: imx7-media-csi: " Uwe Kleine-König
` (30 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Philipp Zabel, Mauro Carvalho Chehab, Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, 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/media/platform/nxp/imx-pxp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c
index fde3c36e5e1d..90f319857c23 100644
--- a/drivers/media/platform/nxp/imx-pxp.c
+++ b/drivers/media/platform/nxp/imx-pxp.c
@@ -1904,7 +1904,7 @@ static int pxp_probe(struct platform_device *pdev)
return ret;
}
-static int pxp_remove(struct platform_device *pdev)
+static void pxp_remove(struct platform_device *pdev)
{
struct pxp_dev *dev = platform_get_drvdata(pdev);
@@ -1922,8 +1922,6 @@ static int pxp_remove(struct platform_device *pdev)
video_unregister_device(&dev->vfd);
v4l2_m2m_release(dev->m2m_dev);
v4l2_device_unregister(&dev->v4l2_dev);
-
- return 0;
}
static const struct pxp_pdata pxp_imx6ull_pdata = {
@@ -1943,7 +1941,7 @@ MODULE_DEVICE_TABLE(of, pxp_dt_ids);
static struct platform_driver pxp_driver = {
.probe = pxp_probe,
- .remove = pxp_remove,
+ .remove_new = pxp_remove,
.driver = {
.name = MEM2MEM_NAME,
.of_match_table = pxp_dt_ids,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 040/117] media: imx7-media-csi: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (14 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 039/117] media: imx-pxp: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 059/117] media: rga: " Uwe Kleine-König
` (29 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Rui Miguel Silva, Laurent Pinchart, Mauro Carvalho Chehab,
Shawn Guo, Sascha Hauer
Cc: Fabio Estevam, NXP Linux Team, linux-media, 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/media/platform/nxp/imx7-media-csi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
index c22bf5c827e7..9ee46c17bd02 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -2278,7 +2278,7 @@ static int imx7_csi_probe(struct platform_device *pdev)
return ret;
}
-static int imx7_csi_remove(struct platform_device *pdev)
+static void imx7_csi_remove(struct platform_device *pdev)
{
struct imx7_csi *csi = platform_get_drvdata(pdev);
@@ -2287,8 +2287,6 @@ static int imx7_csi_remove(struct platform_device *pdev)
v4l2_async_nf_unregister(&csi->notifier);
v4l2_async_nf_cleanup(&csi->notifier);
v4l2_async_unregister_subdev(&csi->sd);
-
- return 0;
}
static const struct of_device_id imx7_csi_of_match[] = {
@@ -2301,7 +2299,7 @@ MODULE_DEVICE_TABLE(of, imx7_csi_of_match);
static struct platform_driver imx7_csi_driver = {
.probe = imx7_csi_probe,
- .remove = imx7_csi_remove,
+ .remove_new = imx7_csi_remove,
.driver = {
.of_match_table = imx7_csi_of_match,
.name = "imx7-csi",
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 059/117] media: rga: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (15 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 040/117] media: imx7-media-csi: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 060/117] media: rkisp1-dev: " Uwe Kleine-König
` (28 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Jacob Chen, Ezequiel Garcia, Mauro Carvalho Chehab,
Heiko Stuebner
Cc: linux-media, linux-rockchip, 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/media/platform/rockchip/rga/rga.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c
index 61b25fcf826e..67dcf22e5ba3 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -930,7 +930,7 @@ static int rga_probe(struct platform_device *pdev)
return ret;
}
-static int rga_remove(struct platform_device *pdev)
+static void rga_remove(struct platform_device *pdev)
{
struct rockchip_rga *rga = platform_get_drvdata(pdev);
@@ -947,8 +947,6 @@ static int rga_remove(struct platform_device *pdev)
v4l2_device_unregister(&rga->v4l2_dev);
pm_runtime_disable(rga->dev);
-
- return 0;
}
static int __maybe_unused rga_runtime_suspend(struct device *dev)
@@ -986,7 +984,7 @@ MODULE_DEVICE_TABLE(of, rockchip_rga_match);
static struct platform_driver rga_pdrv = {
.probe = rga_probe,
- .remove = rga_remove,
+ .remove_new = rga_remove,
.driver = {
.name = RGA_NAME,
.pm = &rga_pm,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 060/117] media: rkisp1-dev: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (16 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 059/117] media: rga: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 061/117] media: gsc-core: " Uwe Kleine-König
` (27 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Dafna Hirschfeld, Mauro Carvalho Chehab, Heiko Stuebner
Cc: linux-media, linux-rockchip, 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/media/platform/rockchip/rkisp1/rkisp1-dev.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
index f2475c6235ea..4762cb32353d 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
@@ -622,7 +622,7 @@ static int rkisp1_probe(struct platform_device *pdev)
return ret;
}
-static int rkisp1_remove(struct platform_device *pdev)
+static void rkisp1_remove(struct platform_device *pdev)
{
struct rkisp1_device *rkisp1 = platform_get_drvdata(pdev);
@@ -638,8 +638,6 @@ static int rkisp1_remove(struct platform_device *pdev)
v4l2_device_unregister(&rkisp1->v4l2_dev);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
static struct platform_driver rkisp1_drv = {
@@ -649,7 +647,7 @@ static struct platform_driver rkisp1_drv = {
.pm = &rkisp1_pm_ops,
},
.probe = rkisp1_probe,
- .remove = rkisp1_remove,
+ .remove_new = rkisp1_remove,
};
module_platform_driver(rkisp1_drv);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 061/117] media: gsc-core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (17 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 060/117] media: rkisp1-dev: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 062/117] media: fimc-core: " Uwe Kleine-König
` (26 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Krzysztof Kozlowski, Uwe Kleine-König,
Colin Ian King, Hans Verkuil
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos-gsc/gsc-core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c
index b147c645ae0b..1fb34de70649 100644
--- a/drivers/media/platform/samsung/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/samsung/exynos-gsc/gsc-core.c
@@ -1201,7 +1201,7 @@ static int gsc_probe(struct platform_device *pdev)
return ret;
}
-static int gsc_remove(struct platform_device *pdev)
+static void gsc_remove(struct platform_device *pdev)
{
struct gsc_dev *gsc = platform_get_drvdata(pdev);
int i;
@@ -1220,7 +1220,6 @@ static int gsc_remove(struct platform_device *pdev)
pm_runtime_set_suspended(&pdev->dev);
dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name);
- return 0;
}
#ifdef CONFIG_PM
@@ -1311,7 +1310,7 @@ static const struct dev_pm_ops gsc_pm_ops = {
static struct platform_driver gsc_driver = {
.probe = gsc_probe,
- .remove = gsc_remove,
+ .remove_new = gsc_remove,
.driver = {
.name = GSC_MODULE_NAME,
.pm = &gsc_pm_ops,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 062/117] media: fimc-core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (18 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 061/117] media: gsc-core: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 063/117] media: fimc-is-i2c: " Uwe Kleine-König
` (25 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Krzysztof Kozlowski
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos4-is/fimc-core.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-core.c b/drivers/media/platform/samsung/exynos4-is/fimc-core.c
index 1791100b6935..a2034ade8b9e 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-core.c
@@ -1092,7 +1092,7 @@ static int fimc_suspend(struct device *dev)
}
#endif /* CONFIG_PM_SLEEP */
-static int fimc_remove(struct platform_device *pdev)
+static void fimc_remove(struct platform_device *pdev)
{
struct fimc_dev *fimc = platform_get_drvdata(pdev);
@@ -1108,7 +1108,6 @@ static int fimc_remove(struct platform_device *pdev)
fimc_clk_put(fimc);
dev_info(&pdev->dev, "driver unloaded\n");
- return 0;
}
/* S5PV210, S5PC110 */
@@ -1160,7 +1159,7 @@ static const struct dev_pm_ops fimc_pm_ops = {
static struct platform_driver fimc_driver = {
.probe = fimc_probe,
- .remove = fimc_remove,
+ .remove_new = fimc_remove,
.driver = {
.of_match_table = fimc_of_match,
.name = FIMC_DRIVER_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 063/117] media: fimc-is-i2c: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (19 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 062/117] media: fimc-core: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 064/117] media: fimc-is: " Uwe Kleine-König
` (24 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Krzysztof Kozlowski
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos4-is/fimc-is-i2c.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c b/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c
index 83a28ef8e099..bef6e9b4a25e 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is-i2c.c
@@ -82,14 +82,12 @@ static int fimc_is_i2c_probe(struct platform_device *pdev)
return ret;
}
-static int fimc_is_i2c_remove(struct platform_device *pdev)
+static void fimc_is_i2c_remove(struct platform_device *pdev)
{
struct fimc_is_i2c *isp_i2c = platform_get_drvdata(pdev);
pm_runtime_disable(&pdev->dev);
i2c_del_adapter(&isp_i2c->adapter);
-
- return 0;
}
#ifdef CONFIG_PM
@@ -140,7 +138,7 @@ static const struct of_device_id fimc_is_i2c_of_match[] = {
static struct platform_driver fimc_is_i2c_driver = {
.probe = fimc_is_i2c_probe,
- .remove = fimc_is_i2c_remove,
+ .remove_new = fimc_is_i2c_remove,
.driver = {
.of_match_table = fimc_is_i2c_of_match,
.name = "fimc-isp-i2c",
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 064/117] media: fimc-is: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (20 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 063/117] media: fimc-is-i2c: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 065/117] media: fimc-lite: " Uwe Kleine-König
` (23 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Krzysztof Kozlowski
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos4-is/fimc-is.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index a7704ff069d6..530a148fe4d3 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -915,7 +915,7 @@ static int fimc_is_suspend(struct device *dev)
}
#endif /* CONFIG_PM_SLEEP */
-static int fimc_is_remove(struct platform_device *pdev)
+static void fimc_is_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct fimc_is *is = dev_get_drvdata(dev);
@@ -932,8 +932,6 @@ static int fimc_is_remove(struct platform_device *pdev)
fimc_is_debugfs_remove(is);
release_firmware(is->fw.f_w);
fimc_is_free_cpu_memory(is);
-
- return 0;
}
static const struct of_device_id fimc_is_of_match[] = {
@@ -950,7 +948,7 @@ static const struct dev_pm_ops fimc_is_pm_ops = {
static struct platform_driver fimc_is_driver = {
.probe = fimc_is_probe,
- .remove = fimc_is_remove,
+ .remove_new = fimc_is_remove,
.driver = {
.of_match_table = fimc_is_of_match,
.name = FIMC_IS_DRV_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 065/117] media: fimc-lite: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (21 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 064/117] media: fimc-is: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 066/117] media: media-dev: " Uwe Kleine-König
` (22 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Krzysztof Kozlowski
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos4-is/fimc-lite.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c
index e185a40305a8..2fadb18560d7 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c
@@ -1595,7 +1595,7 @@ static int fimc_lite_suspend(struct device *dev)
}
#endif /* CONFIG_PM_SLEEP */
-static int fimc_lite_remove(struct platform_device *pdev)
+static void fimc_lite_remove(struct platform_device *pdev)
{
struct fimc_lite *fimc = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
@@ -1610,7 +1610,6 @@ static int fimc_lite_remove(struct platform_device *pdev)
fimc_lite_clk_put(fimc);
dev_info(dev, "Driver unloaded\n");
- return 0;
}
static const struct dev_pm_ops fimc_lite_pm_ops = {
@@ -1656,7 +1655,7 @@ MODULE_DEVICE_TABLE(of, flite_of_match);
static struct platform_driver fimc_lite_driver = {
.probe = fimc_lite_probe,
- .remove = fimc_lite_remove,
+ .remove_new = fimc_lite_remove,
.driver = {
.of_match_table = flite_of_match,
.name = FIMC_LITE_DRV_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 066/117] media: media-dev: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (22 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 065/117] media: fimc-lite: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 067/117] media: mipi-csis: " Uwe Kleine-König
` (21 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Krzysztof Kozlowski
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos4-is/media-dev.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/media-dev.c b/drivers/media/platform/samsung/exynos4-is/media-dev.c
index 98a60f01129d..5ca78fee7804 100644
--- a/drivers/media/platform/samsung/exynos4-is/media-dev.c
+++ b/drivers/media/platform/samsung/exynos4-is/media-dev.c
@@ -1530,12 +1530,12 @@ static int fimc_md_probe(struct platform_device *pdev)
return ret;
}
-static int fimc_md_remove(struct platform_device *pdev)
+static void fimc_md_remove(struct platform_device *pdev)
{
struct fimc_md *fmd = platform_get_drvdata(pdev);
if (!fmd)
- return 0;
+ return;
fimc_md_unregister_clk_provider(fmd);
v4l2_async_nf_unregister(&fmd->subdev_notifier);
@@ -1548,8 +1548,6 @@ static int fimc_md_remove(struct platform_device *pdev)
media_device_unregister(&fmd->media_dev);
media_device_cleanup(&fmd->media_dev);
fimc_md_put_clocks(fmd);
-
- return 0;
}
static const struct platform_device_id fimc_driver_ids[] __always_unused = {
@@ -1566,7 +1564,7 @@ MODULE_DEVICE_TABLE(of, fimc_md_of_match);
static struct platform_driver fimc_md_driver = {
.probe = fimc_md_probe,
- .remove = fimc_md_remove,
+ .remove_new = fimc_md_remove,
.driver = {
.of_match_table = of_match_ptr(fimc_md_of_match),
.name = "s5p-fimc-md",
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 067/117] media: mipi-csis: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (23 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 066/117] media: media-dev: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 069/117] media: g2d: " Uwe Kleine-König
` (20 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Sylwester Nawrocki, Mauro Carvalho Chehab, Krzysztof Kozlowski
Cc: Alim Akhtar, linux-media, linux-arm-kernel, linux-samsung-soc,
kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (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/media/platform/samsung/exynos4-is/mipi-csis.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
index 6a0d35f33e8c..686ca8753ba2 100644
--- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
+++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c
@@ -975,7 +975,7 @@ static int s5pcsis_runtime_resume(struct device *dev)
}
#endif
-static int s5pcsis_remove(struct platform_device *pdev)
+static void s5pcsis_remove(struct platform_device *pdev)
{
struct v4l2_subdev *sd = platform_get_drvdata(pdev);
struct csis_state *state = sd_to_csis_state(sd);
@@ -987,8 +987,6 @@ static int s5pcsis_remove(struct platform_device *pdev)
s5pcsis_clk_put(state);
media_entity_cleanup(&state->sd.entity);
-
- return 0;
}
static const struct dev_pm_ops s5pcsis_pm_ops = {
@@ -1022,7 +1020,7 @@ MODULE_DEVICE_TABLE(of, s5pcsis_of_match);
static struct platform_driver s5pcsis_driver = {
.probe = s5pcsis_probe,
- .remove = s5pcsis_remove,
+ .remove_new = s5pcsis_remove,
.driver = {
.of_match_table = s5pcsis_of_match,
.name = CSIS_DRIVER_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 069/117] media: g2d: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (24 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 067/117] media: mipi-csis: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
[not found] ` <CGME20230403095327eucas1p1095d54fc1e1b89d61d9e974b3cbea853@eucas1p1.samsung.com>
2023-03-26 14:31 ` [PATCH 070/117] media: jpeg-core: " Uwe Kleine-König
` (19 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Łukasz Stelmach, Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, 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/media/platform/samsung/s5p-g2d/g2d.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/samsung/s5p-g2d/g2d.c b/drivers/media/platform/samsung/s5p-g2d/g2d.c
index dd8864779a7c..89aeba47ed07 100644
--- a/drivers/media/platform/samsung/s5p-g2d/g2d.c
+++ b/drivers/media/platform/samsung/s5p-g2d/g2d.c
@@ -740,7 +740,7 @@ static int g2d_probe(struct platform_device *pdev)
return ret;
}
-static int g2d_remove(struct platform_device *pdev)
+static void g2d_remove(struct platform_device *pdev)
{
struct g2d_dev *dev = platform_get_drvdata(pdev);
@@ -753,7 +753,6 @@ static int g2d_remove(struct platform_device *pdev)
clk_put(dev->gate);
clk_unprepare(dev->clk);
clk_put(dev->clk);
- return 0;
}
static struct g2d_variant g2d_drvdata_v3x = {
@@ -778,7 +777,7 @@ MODULE_DEVICE_TABLE(of, exynos_g2d_match);
static struct platform_driver g2d_pdrv = {
.probe = g2d_probe,
- .remove = g2d_remove,
+ .remove_new = g2d_remove,
.driver = {
.name = G2D_NAME,
.of_match_table = exynos_g2d_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 070/117] media: jpeg-core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (25 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 069/117] media: g2d: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-27 12:31 ` Andrzej Pietrasiewicz
2023-03-26 14:31 ` [PATCH 071/117] media: s5p_mfc: " Uwe Kleine-König
` (18 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Andrzej Pietrasiewicz, Jacek Anaszewski, Sylwester Nawrocki,
Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, 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/media/platform/samsung/s5p-jpeg/jpeg-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
index 55814041b8d8..c3c7e48f1b6e 100644
--- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
@@ -2991,7 +2991,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
return ret;
}
-static int s5p_jpeg_remove(struct platform_device *pdev)
+static void s5p_jpeg_remove(struct platform_device *pdev)
{
struct s5p_jpeg *jpeg = platform_get_drvdata(pdev);
int i;
@@ -3008,8 +3008,6 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
for (i = jpeg->variant->num_clocks - 1; i >= 0; i--)
clk_disable_unprepare(jpeg->clocks[i]);
}
-
- return 0;
}
#ifdef CONFIG_PM
@@ -3164,7 +3162,7 @@ static void *jpeg_get_drv_data(struct device *dev)
static struct platform_driver s5p_jpeg_driver = {
.probe = s5p_jpeg_probe,
- .remove = s5p_jpeg_remove,
+ .remove_new = s5p_jpeg_remove,
.driver = {
.of_match_table = of_match_ptr(samsung_jpeg_match),
.name = S5P_JPEG_M2M_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 070/117] media: jpeg-core: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 070/117] media: jpeg-core: " Uwe Kleine-König
@ 2023-03-27 12:31 ` Andrzej Pietrasiewicz
0 siblings, 0 replies; 62+ messages in thread
From: Andrzej Pietrasiewicz @ 2023-03-27 12:31 UTC (permalink / raw)
To: Uwe Kleine-König, Jacek Anaszewski, Sylwester Nawrocki,
Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, kernel
Hi Uwe,
W dniu 26.03.2023 o 16:31, Uwe Kleine-König pisze:
> 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: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
> ---
> drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
> index 55814041b8d8..c3c7e48f1b6e 100644
> --- a/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
> +++ b/drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
> @@ -2991,7 +2991,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int s5p_jpeg_remove(struct platform_device *pdev)
> +static void s5p_jpeg_remove(struct platform_device *pdev)
> {
> struct s5p_jpeg *jpeg = platform_get_drvdata(pdev);
> int i;
> @@ -3008,8 +3008,6 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
> for (i = jpeg->variant->num_clocks - 1; i >= 0; i--)
> clk_disable_unprepare(jpeg->clocks[i]);
> }
> -
> - return 0;
> }
>
> #ifdef CONFIG_PM
> @@ -3164,7 +3162,7 @@ static void *jpeg_get_drv_data(struct device *dev)
>
> static struct platform_driver s5p_jpeg_driver = {
> .probe = s5p_jpeg_probe,
> - .remove = s5p_jpeg_remove,
> + .remove_new = s5p_jpeg_remove,
> .driver = {
> .of_match_table = of_match_ptr(samsung_jpeg_match),
> .name = S5P_JPEG_M2M_NAME,
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 071/117] media: s5p_mfc: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (26 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 070/117] media: jpeg-core: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-27 8:34 ` Andrzej Hajda
2023-03-26 14:31 ` [PATCH 073/117] media: c8sectpfe-core: " Uwe Kleine-König
` (17 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Marek Szyprowski, Andrzej Hajda, Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, 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/media/platform/samsung/s5p-mfc/s5p_mfc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
index 9d2cce124a34..e30e54935d79 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
@@ -1431,7 +1431,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
}
/* Remove the driver */
-static int s5p_mfc_remove(struct platform_device *pdev)
+static void s5p_mfc_remove(struct platform_device *pdev)
{
struct s5p_mfc_dev *dev = platform_get_drvdata(pdev);
struct s5p_mfc_ctx *ctx;
@@ -1463,7 +1463,6 @@ static int s5p_mfc_remove(struct platform_device *pdev)
s5p_mfc_unconfigure_dma_memory(dev);
s5p_mfc_final_pm(dev);
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -1690,7 +1689,7 @@ MODULE_DEVICE_TABLE(of, exynos_mfc_match);
static struct platform_driver s5p_mfc_driver = {
.probe = s5p_mfc_probe,
- .remove = s5p_mfc_remove,
+ .remove_new = s5p_mfc_remove,
.driver = {
.name = S5P_MFC_NAME,
.pm = &s5p_mfc_pm_ops,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 071/117] media: s5p_mfc: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 071/117] media: s5p_mfc: " Uwe Kleine-König
@ 2023-03-27 8:34 ` Andrzej Hajda
0 siblings, 0 replies; 62+ messages in thread
From: Andrzej Hajda @ 2023-03-27 8:34 UTC (permalink / raw)
To: Uwe Kleine-König, Marek Szyprowski, Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, kernel
On 26.03.2023 16:31, 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: Andrzej Hajda <andrzej.hajda@intel.com>
Regards
Andrzej
> ---
> drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
> index 9d2cce124a34..e30e54935d79 100644
> --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
> @@ -1431,7 +1431,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
> }
>
> /* Remove the driver */
> -static int s5p_mfc_remove(struct platform_device *pdev)
> +static void s5p_mfc_remove(struct platform_device *pdev)
> {
> struct s5p_mfc_dev *dev = platform_get_drvdata(pdev);
> struct s5p_mfc_ctx *ctx;
> @@ -1463,7 +1463,6 @@ static int s5p_mfc_remove(struct platform_device *pdev)
> s5p_mfc_unconfigure_dma_memory(dev);
>
> s5p_mfc_final_pm(dev);
> - return 0;
> }
>
> #ifdef CONFIG_PM_SLEEP
> @@ -1690,7 +1689,7 @@ MODULE_DEVICE_TABLE(of, exynos_mfc_match);
>
> static struct platform_driver s5p_mfc_driver = {
> .probe = s5p_mfc_probe,
> - .remove = s5p_mfc_remove,
> + .remove_new = s5p_mfc_remove,
> .driver = {
> .name = S5P_MFC_NAME,
> .pm = &s5p_mfc_pm_ops,
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 073/117] media: c8sectpfe-core: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (27 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 071/117] media: s5p_mfc: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 076/117] media: dma2d: " Uwe Kleine-König
` (16 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Patrice Chotard, Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, 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/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
index c38b62d4f1ae..45ade7210d26 100644
--- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c
@@ -878,7 +878,7 @@ static int c8sectpfe_probe(struct platform_device *pdev)
return ret;
}
-static int c8sectpfe_remove(struct platform_device *pdev)
+static void c8sectpfe_remove(struct platform_device *pdev)
{
struct c8sectpfei *fei = platform_get_drvdata(pdev);
struct channel_info *channel;
@@ -910,8 +910,6 @@ static int c8sectpfe_remove(struct platform_device *pdev)
writel(0, fei->io + SYS_OTHER_CLKEN);
clk_disable_unprepare(fei->c8sectpfeclk);
-
- return 0;
}
@@ -1178,7 +1176,7 @@ static struct platform_driver c8sectpfe_driver = {
.of_match_table = of_match_ptr(c8sectpfe_match),
},
.probe = c8sectpfe_probe,
- .remove = c8sectpfe_remove,
+ .remove_new = c8sectpfe_remove,
};
module_platform_driver(c8sectpfe_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 076/117] media: dma2d: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (28 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 073/117] media: c8sectpfe-core: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 077/117] media: stm32-dcmi: " Uwe Kleine-König
` (15 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Maxime Coquelin, Alexandre Torgue,
Uwe Kleine-König
Cc: linux-media, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/media/platform/st/stm32/dma2d/dma2d.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/st/stm32/dma2d/dma2d.c b/drivers/media/platform/st/stm32/dma2d/dma2d.c
index 9706aa41b5d2..be56d2b5fae9 100644
--- a/drivers/media/platform/st/stm32/dma2d/dma2d.c
+++ b/drivers/media/platform/st/stm32/dma2d/dma2d.c
@@ -696,7 +696,7 @@ static int dma2d_probe(struct platform_device *pdev)
return ret;
}
-static int dma2d_remove(struct platform_device *pdev)
+static void dma2d_remove(struct platform_device *pdev)
{
struct dma2d_dev *dev = platform_get_drvdata(pdev);
@@ -707,8 +707,6 @@ static int dma2d_remove(struct platform_device *pdev)
vb2_dma_contig_clear_max_seg_size(&pdev->dev);
clk_unprepare(dev->gate);
clk_put(dev->gate);
-
- return 0;
}
static const struct of_device_id stm32_dma2d_match[] = {
@@ -722,7 +720,7 @@ MODULE_DEVICE_TABLE(of, stm32_dma2d_match);
static struct platform_driver dma2d_pdrv = {
.probe = dma2d_probe,
- .remove = dma2d_remove,
+ .remove_new = dma2d_remove,
.driver = {
.name = DMA2D_NAME,
.of_match_table = stm32_dma2d_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 077/117] media: stm32-dcmi: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (29 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 076/117] media: dma2d: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 078/117] media: sun4i_csi: " Uwe Kleine-König
` (14 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Hugues Fruchet, Mauro Carvalho Chehab, Maxime Coquelin,
Alexandre Torgue
Cc: linux-media, linux-stm32, linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/media/platform/st/stm32/stm32-dcmi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index ad8e9742e1ae..dc3ce08259d5 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -2134,7 +2134,7 @@ static int dcmi_probe(struct platform_device *pdev)
return ret;
}
-static int dcmi_remove(struct platform_device *pdev)
+static void dcmi_remove(struct platform_device *pdev)
{
struct stm32_dcmi *dcmi = platform_get_drvdata(pdev);
@@ -2147,8 +2147,6 @@ static int dcmi_remove(struct platform_device *pdev)
media_device_cleanup(&dcmi->mdev);
dma_release_channel(dcmi->dma_chan);
-
- return 0;
}
static __maybe_unused int dcmi_runtime_suspend(struct device *dev)
@@ -2202,7 +2200,7 @@ static const struct dev_pm_ops dcmi_pm_ops = {
static struct platform_driver stm32_dcmi_driver = {
.probe = dcmi_probe,
- .remove = dcmi_remove,
+ .remove_new = dcmi_remove,
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(stm32_dcmi_of_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 078/117] media: sun4i_csi: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (30 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 077/117] media: stm32-dcmi: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 18:19 ` Jernej Škrabec
2023-03-26 14:31 ` [PATCH 079/117] media: sun6i_csi: " Uwe Kleine-König
` (13 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Maxime Ripard, Mauro Carvalho Chehab, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland
Cc: linux-media, 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/media/platform/sunxi/sun4i-csi/sun4i_csi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
index 86c5235a0c7a..d6e7d1b36083 100644
--- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
+++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_csi.c
@@ -260,7 +260,7 @@ static int sun4i_csi_probe(struct platform_device *pdev)
return ret;
}
-static int sun4i_csi_remove(struct platform_device *pdev)
+static void sun4i_csi_remove(struct platform_device *pdev)
{
struct sun4i_csi *csi = platform_get_drvdata(pdev);
@@ -271,8 +271,6 @@ static int sun4i_csi_remove(struct platform_device *pdev)
media_device_unregister(&csi->mdev);
sun4i_csi_dma_unregister(csi);
media_device_cleanup(&csi->mdev);
-
- return 0;
}
static const struct sun4i_csi_traits sun4i_a10_csi1_traits = {
@@ -330,7 +328,7 @@ static const struct dev_pm_ops sun4i_csi_pm_ops = {
static struct platform_driver sun4i_csi_driver = {
.probe = sun4i_csi_probe,
- .remove = sun4i_csi_remove,
+ .remove_new = sun4i_csi_remove,
.driver = {
.name = "sun4i-csi",
.of_match_table = sun4i_csi_of_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 078/117] media: sun4i_csi: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 078/117] media: sun4i_csi: " Uwe Kleine-König
@ 2023-03-26 18:19 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:19 UTC (permalink / raw)
To: Maxime Ripard, Mauro Carvalho Chehab, Chen-Yu Tsai,
Samuel Holland, Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:31:45 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 079/117] media: sun6i_csi: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (31 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 078/117] media: sun4i_csi: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 18:19 ` Jernej Škrabec
2023-03-26 14:31 ` [PATCH 080/117] media: sun6i_mipi_csi2: " Uwe Kleine-König
` (12 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Yong Deng, Paul Kocialkowski, Mauro Carvalho Chehab, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland
Cc: linux-media, 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/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
index e3e6650181c8..e2723cfa4515 100644
--- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
+++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c
@@ -375,7 +375,7 @@ static int sun6i_csi_probe(struct platform_device *platform_dev)
return ret;
}
-static int sun6i_csi_remove(struct platform_device *pdev)
+static void sun6i_csi_remove(struct platform_device *pdev)
{
struct sun6i_csi_device *csi_dev = platform_get_drvdata(pdev);
@@ -386,8 +386,6 @@ static int sun6i_csi_remove(struct platform_device *pdev)
sun6i_csi_v4l2_cleanup(csi_dev);
sun6i_csi_resources_cleanup(csi_dev);
-
- return 0;
}
static const struct sun6i_csi_variant sun6i_a31_csi_variant = {
@@ -426,7 +424,7 @@ MODULE_DEVICE_TABLE(of, sun6i_csi_of_match);
static struct platform_driver sun6i_csi_platform_driver = {
.probe = sun6i_csi_probe,
- .remove = sun6i_csi_remove,
+ .remove_new = sun6i_csi_remove,
.driver = {
.name = SUN6I_CSI_NAME,
.of_match_table = of_match_ptr(sun6i_csi_of_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 079/117] media: sun6i_csi: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 079/117] media: sun6i_csi: " Uwe Kleine-König
@ 2023-03-26 18:19 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:19 UTC (permalink / raw)
To: Yong Deng, Paul Kocialkowski, Mauro Carvalho Chehab, Chen-Yu Tsai,
Samuel Holland, Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:31:46 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 080/117] media: sun6i_mipi_csi2: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (32 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 079/117] media: sun6i_csi: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 18:18 ` Jernej Škrabec
2023-03-26 14:31 ` [PATCH 081/117] media: sun8i_a83t_mipi_csi2: " Uwe Kleine-König
` (11 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Paul Kocialkowski, Mauro Carvalho Chehab, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland
Cc: linux-media, 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>
---
.../media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c
index a220ce849b41..dce130b4c9f6 100644
--- a/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c
+++ b/drivers/media/platform/sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c
@@ -737,15 +737,13 @@ static int sun6i_mipi_csi2_probe(struct platform_device *platform_dev)
return ret;
}
-static int sun6i_mipi_csi2_remove(struct platform_device *platform_dev)
+static void sun6i_mipi_csi2_remove(struct platform_device *platform_dev)
{
struct sun6i_mipi_csi2_device *csi2_dev =
platform_get_drvdata(platform_dev);
sun6i_mipi_csi2_bridge_cleanup(csi2_dev);
sun6i_mipi_csi2_resources_cleanup(csi2_dev);
-
- return 0;
}
static const struct of_device_id sun6i_mipi_csi2_of_match[] = {
@@ -756,7 +754,7 @@ MODULE_DEVICE_TABLE(of, sun6i_mipi_csi2_of_match);
static struct platform_driver sun6i_mipi_csi2_platform_driver = {
.probe = sun6i_mipi_csi2_probe,
- .remove = sun6i_mipi_csi2_remove,
+ .remove_new = sun6i_mipi_csi2_remove,
.driver = {
.name = SUN6I_MIPI_CSI2_NAME,
.of_match_table = of_match_ptr(sun6i_mipi_csi2_of_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 080/117] media: sun6i_mipi_csi2: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 080/117] media: sun6i_mipi_csi2: " Uwe Kleine-König
@ 2023-03-26 18:18 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:18 UTC (permalink / raw)
To: Paul Kocialkowski, Mauro Carvalho Chehab, Chen-Yu Tsai,
Samuel Holland, Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:31:47 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 081/117] media: sun8i_a83t_mipi_csi2: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (33 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 080/117] media: sun6i_mipi_csi2: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 18:18 ` Jernej Škrabec
2023-03-26 14:31 ` [PATCH 082/117] media: sun8i-di: " Uwe Kleine-König
` (10 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Hans Verkuil, Paul Kocialkowski, Sakari Ailus,
Maxime Ripard, Uwe Kleine-König, Christophe JAILLET
Cc: linux-media, 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>
---
.../sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c
index cd2e92ae2293..23d32e198aaa 100644
--- a/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c
+++ b/drivers/media/platform/sunxi/sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c
@@ -804,15 +804,13 @@ static int sun8i_a83t_mipi_csi2_probe(struct platform_device *platform_dev)
return ret;
}
-static int sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_dev)
+static void sun8i_a83t_mipi_csi2_remove(struct platform_device *platform_dev)
{
struct sun8i_a83t_mipi_csi2_device *csi2_dev =
platform_get_drvdata(platform_dev);
sun8i_a83t_mipi_csi2_bridge_cleanup(csi2_dev);
sun8i_a83t_mipi_csi2_resources_cleanup(csi2_dev);
-
- return 0;
}
static const struct of_device_id sun8i_a83t_mipi_csi2_of_match[] = {
@@ -823,7 +821,7 @@ MODULE_DEVICE_TABLE(of, sun8i_a83t_mipi_csi2_of_match);
static struct platform_driver sun8i_a83t_mipi_csi2_platform_driver = {
.probe = sun8i_a83t_mipi_csi2_probe,
- .remove = sun8i_a83t_mipi_csi2_remove,
+ .remove_new = sun8i_a83t_mipi_csi2_remove,
.driver = {
.name = SUN8I_A83T_MIPI_CSI2_NAME,
.of_match_table = of_match_ptr(sun8i_a83t_mipi_csi2_of_match),
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 081/117] media: sun8i_a83t_mipi_csi2: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 081/117] media: sun8i_a83t_mipi_csi2: " Uwe Kleine-König
@ 2023-03-26 18:18 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:18 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Chen-Yu Tsai, Samuel Holland, Hans Verkuil,
Paul Kocialkowski, Sakari Ailus, Maxime Ripard,
Uwe Kleine-König, Christophe JAILLET, Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:31:48 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 082/117] media: sun8i-di: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (34 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 081/117] media: sun8i_a83t_mipi_csi2: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 18:17 ` Jernej Škrabec
2023-03-26 14:31 ` [PATCH 083/117] media: sun8i_rotate: " Uwe Kleine-König
` (9 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Jernej Skrabec, Mauro Carvalho Chehab, Chen-Yu Tsai,
Samuel Holland
Cc: linux-media, 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/media/platform/sunxi/sun8i-di/sun8i-di.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
index aa65d70b6270..e4b0fd793f55 100644
--- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
+++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
@@ -906,7 +906,7 @@ static int deinterlace_probe(struct platform_device *pdev)
return ret;
}
-static int deinterlace_remove(struct platform_device *pdev)
+static void deinterlace_remove(struct platform_device *pdev)
{
struct deinterlace_dev *dev = platform_get_drvdata(pdev);
@@ -915,8 +915,6 @@ static int deinterlace_remove(struct platform_device *pdev)
v4l2_device_unregister(&dev->v4l2_dev);
pm_runtime_force_suspend(&pdev->dev);
-
- return 0;
}
static int deinterlace_runtime_resume(struct device *device)
@@ -1002,7 +1000,7 @@ static const struct dev_pm_ops deinterlace_pm_ops = {
static struct platform_driver deinterlace_driver = {
.probe = deinterlace_probe,
- .remove = deinterlace_remove,
+ .remove_new = deinterlace_remove,
.driver = {
.name = DEINTERLACE_NAME,
.of_match_table = deinterlace_dt_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 082/117] media: sun8i-di: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 082/117] media: sun8i-di: " Uwe Kleine-König
@ 2023-03-26 18:17 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:17 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Chen-Yu Tsai, Samuel Holland,
Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:31:49 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 083/117] media: sun8i_rotate: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (35 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 082/117] media: sun8i-di: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
2023-03-26 18:18 ` Jernej Škrabec
2023-03-26 14:32 ` [PATCH 095/117] media: xilinx-csi2rxss: " Uwe Kleine-König
` (8 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
To: Jernej Skrabec, Mauro Carvalho Chehab, Chen-Yu Tsai,
Samuel Holland
Cc: linux-media, 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/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c
index fbcca59a0517..bd0c4257bbff 100644
--- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c
+++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c
@@ -833,7 +833,7 @@ static int rotate_probe(struct platform_device *pdev)
return ret;
}
-static int rotate_remove(struct platform_device *pdev)
+static void rotate_remove(struct platform_device *pdev)
{
struct rotate_dev *dev = platform_get_drvdata(pdev);
@@ -842,8 +842,6 @@ static int rotate_remove(struct platform_device *pdev)
v4l2_device_unregister(&dev->v4l2_dev);
pm_runtime_force_suspend(&pdev->dev);
-
- return 0;
}
static int rotate_runtime_resume(struct device *device)
@@ -907,7 +905,7 @@ static const struct dev_pm_ops rotate_pm_ops = {
static struct platform_driver rotate_driver = {
.probe = rotate_probe,
- .remove = rotate_remove,
+ .remove_new = rotate_remove,
.driver = {
.name = ROTATE_NAME,
.of_match_table = rotate_dt_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 083/117] media: sun8i_rotate: Convert to platform remove callback returning void
2023-03-26 14:31 ` [PATCH 083/117] media: sun8i_rotate: " Uwe Kleine-König
@ 2023-03-26 18:18 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:18 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Chen-Yu Tsai, Samuel Holland,
Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:31:50 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 095/117] media: xilinx-csi2rxss: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (36 preceding siblings ...)
2023-03-26 14:31 ` [PATCH 083/117] media: sun8i_rotate: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 096/117] media: xilinx-tpg: " Uwe Kleine-König
` (7 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Hyun Kwon, Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek
Cc: linux-media, 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/media/platform/xilinx/xilinx-csi2rxss.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
index d8a23f18cfbc..5b53745fe44e 100644
--- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c
+++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
@@ -1059,7 +1059,7 @@ static int xcsi2rxss_probe(struct platform_device *pdev)
return ret;
}
-static int xcsi2rxss_remove(struct platform_device *pdev)
+static void xcsi2rxss_remove(struct platform_device *pdev)
{
struct xcsi2rxss_state *xcsi2rxss = platform_get_drvdata(pdev);
struct v4l2_subdev *subdev = &xcsi2rxss->subdev;
@@ -1070,8 +1070,6 @@ static int xcsi2rxss_remove(struct platform_device *pdev)
mutex_destroy(&xcsi2rxss->lock);
clk_bulk_disable_unprepare(num_clks, xcsi2rxss->clks);
clk_bulk_put(num_clks, xcsi2rxss->clks);
-
- return 0;
}
static const struct of_device_id xcsi2rxss_of_id_table[] = {
@@ -1086,7 +1084,7 @@ static struct platform_driver xcsi2rxss_driver = {
.of_match_table = xcsi2rxss_of_id_table,
},
.probe = xcsi2rxss_probe,
- .remove = xcsi2rxss_remove,
+ .remove_new = xcsi2rxss_remove,
};
module_platform_driver(xcsi2rxss_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 096/117] media: xilinx-tpg: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (37 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 095/117] media: xilinx-csi2rxss: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 097/117] media: xilinx-vipp: " Uwe Kleine-König
` (6 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Hyun Kwon, Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek
Cc: linux-media, 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/media/platform/xilinx/xilinx-tpg.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c
index 0f2d5a0edf0c..80353ca44402 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -894,7 +894,7 @@ static int xtpg_probe(struct platform_device *pdev)
return ret;
}
-static int xtpg_remove(struct platform_device *pdev)
+static void xtpg_remove(struct platform_device *pdev)
{
struct xtpg_device *xtpg = platform_get_drvdata(pdev);
struct v4l2_subdev *subdev = &xtpg->xvip.subdev;
@@ -904,8 +904,6 @@ static int xtpg_remove(struct platform_device *pdev)
media_entity_cleanup(&subdev->entity);
xvip_cleanup_resources(&xtpg->xvip);
-
- return 0;
}
static SIMPLE_DEV_PM_OPS(xtpg_pm_ops, xtpg_pm_suspend, xtpg_pm_resume);
@@ -923,7 +921,7 @@ static struct platform_driver xtpg_driver = {
.of_match_table = xtpg_of_id_table,
},
.probe = xtpg_probe,
- .remove = xtpg_remove,
+ .remove_new = xtpg_remove,
};
module_platform_driver(xtpg_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 097/117] media: xilinx-vipp: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (38 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 096/117] media: xilinx-tpg: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 098/117] media: xilinx-vtc: " Uwe Kleine-König
` (5 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Hyun Kwon, Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek
Cc: linux-media, 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/media/platform/xilinx/xilinx-vipp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index 0a16c218a50a..3123216b3f70 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -617,14 +617,12 @@ static int xvip_composite_probe(struct platform_device *pdev)
return ret;
}
-static int xvip_composite_remove(struct platform_device *pdev)
+static void xvip_composite_remove(struct platform_device *pdev)
{
struct xvip_composite_device *xdev = platform_get_drvdata(pdev);
xvip_graph_cleanup(xdev);
xvip_composite_v4l2_cleanup(xdev);
-
- return 0;
}
static const struct of_device_id xvip_composite_of_id_table[] = {
@@ -639,7 +637,7 @@ static struct platform_driver xvip_composite_driver = {
.of_match_table = xvip_composite_of_id_table,
},
.probe = xvip_composite_probe,
- .remove = xvip_composite_remove,
+ .remove_new = xvip_composite_remove,
};
module_platform_driver(xvip_composite_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 098/117] media: xilinx-vtc: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (39 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 097/117] media: xilinx-vipp: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 106/117] media: meson-ir-tx: " Uwe Kleine-König
` (4 subsequent siblings)
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Hyun Kwon, Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek
Cc: linux-media, 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/media/platform/xilinx/xilinx-vtc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/xilinx/xilinx-vtc.c b/drivers/media/platform/xilinx/xilinx-vtc.c
index 0ae0208d7529..0d5e35c29488 100644
--- a/drivers/media/platform/xilinx/xilinx-vtc.c
+++ b/drivers/media/platform/xilinx/xilinx-vtc.c
@@ -344,15 +344,13 @@ static int xvtc_probe(struct platform_device *pdev)
return 0;
}
-static int xvtc_remove(struct platform_device *pdev)
+static void xvtc_remove(struct platform_device *pdev)
{
struct xvtc_device *xvtc = platform_get_drvdata(pdev);
xvtc_unregister_device(xvtc);
xvip_cleanup_resources(&xvtc->xvip);
-
- return 0;
}
static const struct of_device_id xvtc_of_id_table[] = {
@@ -367,7 +365,7 @@ static struct platform_driver xvtc_driver = {
.of_match_table = xvtc_of_id_table,
},
.probe = xvtc_probe,
- .remove = xvtc_remove,
+ .remove_new = xvtc_remove,
};
module_platform_driver(xvtc_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 106/117] media: meson-ir-tx: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (40 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 098/117] media: xilinx-vtc: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-04-03 20:40 ` Martin Blumenstingl
2023-03-26 14:32 ` [PATCH 107/117] media: meson-ir: " Uwe Kleine-König
` (3 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Sean Young, Mauro Carvalho Chehab, Neil Armstrong, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-media, linux-arm-kernel,
linux-amlogic, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/media/rc/meson-ir-tx.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/rc/meson-ir-tx.c b/drivers/media/rc/meson-ir-tx.c
index abdb62b16e98..6355b79893fb 100644
--- a/drivers/media/rc/meson-ir-tx.c
+++ b/drivers/media/rc/meson-ir-tx.c
@@ -372,13 +372,11 @@ static int __init meson_irtx_probe(struct platform_device *pdev)
return 0;
}
-static int meson_irtx_remove(struct platform_device *pdev)
+static void meson_irtx_remove(struct platform_device *pdev)
{
struct rc_dev *rc = platform_get_drvdata(pdev);
rc_unregister_device(rc);
-
- return 0;
}
static const struct of_device_id meson_irtx_dt_match[] = {
@@ -390,7 +388,7 @@ static const struct of_device_id meson_irtx_dt_match[] = {
MODULE_DEVICE_TABLE(of, meson_irtx_dt_match);
static struct platform_driver meson_irtx_pd = {
- .remove = meson_irtx_remove,
+ .remove_new = meson_irtx_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = meson_irtx_dt_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 106/117] media: meson-ir-tx: Convert to platform remove callback returning void
2023-03-26 14:32 ` [PATCH 106/117] media: meson-ir-tx: " Uwe Kleine-König
@ 2023-04-03 20:40 ` Martin Blumenstingl
0 siblings, 0 replies; 62+ messages in thread
From: Martin Blumenstingl @ 2023-04-03 20:40 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Sean Young, Mauro Carvalho Chehab, Neil Armstrong, Kevin Hilman,
Jerome Brunet, linux-media, linux-arm-kernel, linux-amlogic,
kernel
On Sun, Mar 26, 2023 at 4:32 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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 107/117] media: meson-ir: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (41 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 106/117] media: meson-ir-tx: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-04-03 20:41 ` Martin Blumenstingl
2023-03-26 14:32 ` [PATCH 108/117] media: mtk-cir: " Uwe Kleine-König
` (2 subsequent siblings)
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Sean Young, Mauro Carvalho Chehab, Neil Armstrong, Kevin Hilman
Cc: Jerome Brunet, Martin Blumenstingl, linux-media, linux-arm-kernel,
linux-amlogic, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/media/rc/meson-ir.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index 4b769111f78e..49aa309d1a8c 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -177,7 +177,7 @@ static int meson_ir_probe(struct platform_device *pdev)
return 0;
}
-static int meson_ir_remove(struct platform_device *pdev)
+static void meson_ir_remove(struct platform_device *pdev)
{
struct meson_ir *ir = platform_get_drvdata(pdev);
unsigned long flags;
@@ -186,8 +186,6 @@ static int meson_ir_remove(struct platform_device *pdev)
spin_lock_irqsave(&ir->lock, flags);
meson_ir_set_mask(ir, IR_DEC_REG1, REG1_ENABLE, 0);
spin_unlock_irqrestore(&ir->lock, flags);
-
- return 0;
}
static void meson_ir_shutdown(struct platform_device *pdev)
@@ -226,7 +224,7 @@ MODULE_DEVICE_TABLE(of, meson_ir_match);
static struct platform_driver meson_ir_driver = {
.probe = meson_ir_probe,
- .remove = meson_ir_remove,
+ .remove_new = meson_ir_remove,
.shutdown = meson_ir_shutdown,
.driver = {
.name = DRIVER_NAME,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 107/117] media: meson-ir: Convert to platform remove callback returning void
2023-03-26 14:32 ` [PATCH 107/117] media: meson-ir: " Uwe Kleine-König
@ 2023-04-03 20:41 ` Martin Blumenstingl
0 siblings, 0 replies; 62+ messages in thread
From: Martin Blumenstingl @ 2023-04-03 20:41 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Sean Young, Mauro Carvalho Chehab, Neil Armstrong, Kevin Hilman,
Jerome Brunet, linux-media, linux-arm-kernel, linux-amlogic,
kernel
On Sun, Mar 26, 2023 at 4:32 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>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread
* [PATCH 108/117] media: mtk-cir: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (42 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 107/117] media: meson-ir: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 109/117] media: st_rc: " Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 110/117] media: sunxi-cir: " Uwe Kleine-König
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Sean Wang, Sean Young, Mauro Carvalho Chehab, Matthias Brugger
Cc: AngeloGioacchino Del Regno, linux-media, kernel, linux-arm-kernel,
linux-mediatek
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/media/rc/mtk-cir.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/rc/mtk-cir.c b/drivers/media/rc/mtk-cir.c
index 27b7412d02a5..df9349330a93 100644
--- a/drivers/media/rc/mtk-cir.c
+++ b/drivers/media/rc/mtk-cir.c
@@ -420,7 +420,7 @@ static int mtk_ir_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_ir_remove(struct platform_device *pdev)
+static void mtk_ir_remove(struct platform_device *pdev)
{
struct mtk_ir *ir = platform_get_drvdata(pdev);
@@ -434,13 +434,11 @@ static int mtk_ir_remove(struct platform_device *pdev)
clk_disable_unprepare(ir->bus);
clk_disable_unprepare(ir->clk);
-
- return 0;
}
static struct platform_driver mtk_ir_driver = {
.probe = mtk_ir_probe,
- .remove = mtk_ir_remove,
+ .remove_new = mtk_ir_remove,
.driver = {
.name = MTK_IR_DEV,
.of_match_table = mtk_ir_match,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 109/117] media: st_rc: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (43 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 108/117] media: mtk-cir: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 14:32 ` [PATCH 110/117] media: sunxi-cir: " Uwe Kleine-König
45 siblings, 0 replies; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Patrice Chotard, Sean Young, Mauro Carvalho Chehab
Cc: linux-arm-kernel, linux-media, 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/media/rc/st_rc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 19e987a048cc..28477aa95563 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -194,7 +194,7 @@ static int st_rc_hardware_init(struct st_rc_device *dev)
return 0;
}
-static int st_rc_remove(struct platform_device *pdev)
+static void st_rc_remove(struct platform_device *pdev)
{
struct st_rc_device *rc_dev = platform_get_drvdata(pdev);
@@ -202,7 +202,6 @@ static int st_rc_remove(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, false);
clk_disable_unprepare(rc_dev->sys_clock);
rc_unregister_device(rc_dev->rdev);
- return 0;
}
static int st_rc_open(struct rc_dev *rdev)
@@ -408,7 +407,7 @@ static struct platform_driver st_rc_driver = {
.pm = &st_rc_pm_ops,
},
.probe = st_rc_probe,
- .remove = st_rc_remove,
+ .remove_new = st_rc_remove,
};
module_platform_driver(st_rc_driver);
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* [PATCH 110/117] media: sunxi-cir: Convert to platform remove callback returning void
[not found] <20230326143224.572654-1-u.kleine-koenig@pengutronix.de>
` (44 preceding siblings ...)
2023-03-26 14:32 ` [PATCH 109/117] media: st_rc: " Uwe Kleine-König
@ 2023-03-26 14:32 ` Uwe Kleine-König
2023-03-26 18:19 ` Jernej Škrabec
45 siblings, 1 reply; 62+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:32 UTC (permalink / raw)
To: Sean Young, Mauro Carvalho Chehab, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland
Cc: linux-media, 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/media/rc/sunxi-cir.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index b631a81e58bb..75b7aed1579c 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -364,14 +364,12 @@ static int sunxi_ir_probe(struct platform_device *pdev)
return ret;
}
-static int sunxi_ir_remove(struct platform_device *pdev)
+static void sunxi_ir_remove(struct platform_device *pdev)
{
struct sunxi_ir *ir = platform_get_drvdata(pdev);
rc_unregister_device(ir->rc);
sunxi_ir_hw_exit(&pdev->dev);
-
- return 0;
}
static void sunxi_ir_shutdown(struct platform_device *pdev)
@@ -413,7 +411,7 @@ MODULE_DEVICE_TABLE(of, sunxi_ir_match);
static struct platform_driver sunxi_ir_driver = {
.probe = sunxi_ir_probe,
- .remove = sunxi_ir_remove,
+ .remove_new = sunxi_ir_remove,
.shutdown = sunxi_ir_shutdown,
.driver = {
.name = SUNXI_IR_DEV,
--
2.39.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 62+ messages in thread* Re: [PATCH 110/117] media: sunxi-cir: Convert to platform remove callback returning void
2023-03-26 14:32 ` [PATCH 110/117] media: sunxi-cir: " Uwe Kleine-König
@ 2023-03-26 18:19 ` Jernej Škrabec
0 siblings, 0 replies; 62+ messages in thread
From: Jernej Škrabec @ 2023-03-26 18:19 UTC (permalink / raw)
To: Sean Young, Mauro Carvalho Chehab, Chen-Yu Tsai, Samuel Holland,
Uwe Kleine-König
Cc: linux-media, linux-arm-kernel, linux-sunxi, kernel
Dne nedelja, 26. marec 2023 ob 16:32:17 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 62+ messages in thread