linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 000/117] media: Convert to platform remove callback returning void
@ 2023-03-26 14:30 Uwe Kleine-König
  2023-03-26 14:31 ` [PATCH 047/117] media: rcar-fcp: " Uwe Kleine-König
                   ` (9 more replies)
  0 siblings, 10 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:30 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Benson Leung, Ajye Huang,
	Rory Liu, Scott Chao, Neil Armstrong, Kevin Hilman,
	Marek Szyprowski, Ettore Chimenti, Alain Volmat, Maxime Coquelin,
	Alexandre Torgue, Sean Young, Sakari Ailus, Ricardo Ribalda,
	Laurent Pinchart, Yang Yingliang, Thierry Reding,
	Jonathan Hunter, Antti Palosaari, Michael Tretter, Ming Qian,
	Shijie Qin, Zhou Peng, Eddie James, Joel Stanley, Eugen Hristev,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Ripard,
	Philipp Zabel, Bin Liu, Matthias Brugger, Minghsiu Tsai,
	Houlong Wei, Andrew-CT Chen, Moudy Ho, Qiheng Lin, Tiffany Lin,
	Yunfei Dong, Dmitry Osipenko, Xavier Roumegue, Mirela Rabulea,
	Shawn Guo, Sascha Hauer, Rui Miguel Silva, Robert Foss,
	Todor Tomov, Andy Gross, Bjorn Andersson, Stanimir Varbanov,
	Vikash Garodia, Niklas Söderlund, Fabrizio Castro,
	Kieran Bingham, Mikhail Ulyanov, Jacopo Mondi, Lad Prabhakar,
	Nathan Chancellor, Yang Li, Dan Carpenter, Jacob Chen,
	Ezequiel Garcia, Heiko Stuebner, Dafna Hirschfeld,
	Krzysztof Kozlowski, Colin Ian King, Sylwester Nawrocki,
	Sylwester Nawrocki, Łukasz Stelmach, Andrzej Pietrasiewicz,
	Jacek Anaszewski, Andrzej Hajda, Fabien Dessenne,
	Patrice Chotard, Hugues Fruchet, Jean-Christophe Trotin,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Yong Deng,
	Paul Kocialkowski, Christophe JAILLET, Lad, Prabhakar,
	Benoit Parrot, Hyun Kwon, Michal Simek, ye xingchen,
	Eduardo Valentin, Sean Wang, Daniel W. S. Almeida, Shuah Khan,
	Daniel Almeida, Hans Verkuil
  Cc: linux-media, kernel, Guenter Roeck, chrome-platform,
	Jerome Brunet, Martin Blumenstingl, linux-amlogic,
	linux-arm-kernel, linux-samsung-soc, linux-stm32, linux-tegra,
	Andrew Jeffery, openbmc, linux-aspeed,
	AngeloGioacchino Del Regno, linux-mediatek, NXP Linux Team,
	Fabio Estevam, Konrad Dybcio, linux-arm-msm, linux-renesas-soc,
	linux-rockchip, Alim Akhtar, linux-sunxi, Kieran Bingham

Hello,

this series adapts the platform drivers below drivers/pci to use the
.remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver core
doesn't (and cannot) cope for errors during remove. The only effect of a
non-zero return value in .remove() is that the driver core emits a warning. The
device is removed anyhow and an early return from .remove() usually yields a
resource leak.

By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.

Only three drivers needed some preparation first to make sure they
return 0 unconditionally in their remove callback. Then all drivers
could be trivially converted without side effects to .remove_new().

The changes to the individual drivers are all orthogonal. If I need to
resend some patches because of some review feedback, I'd like to only
send the patches that actually needed changes, so please pick up the
remaining patches that don't need changing to reduce the amount of mail.

Best regards
Uwe

Uwe Kleine-König (117):
  media: cec-gpio: Convert to platform remove callback returning void
  media: cros-ec-cec: Don't exit early in .remove() callback
  media: cros-ec-cec: Convert to platform remove callback returning void
  media: ao-cec-g12a: Convert to platform remove callback returning void
  media: ao-cec: Convert to platform remove callback returning void
  media: s5p_cec: Convert to platform remove callback returning void
  media: seco-cec: Convert to platform remove callback returning void
  media: stih-cec: Convert to platform remove callback returning void
  media: stm32-cec: Convert to platform remove callback returning void
  media: tegra_cec: Convert to platform remove callback returning void
  media: rtl2832_sdr: Convert to platform remove callback returning void
  media: zd1301_demod: Convert to platform remove callback returning
    void
  media: allegro-core: Convert to platform remove callback returning
    void
  media: ge2d: Convert to platform remove callback returning void
  media: vpu_core: Convert to platform remove callback returning void
  media: vpu_drv: Convert to platform remove callback returning void
  media: aspeed-video: Convert to platform remove callback returning
    void
  media: atmel-isi: Convert to platform remove callback returning void
  media: cdns-csi2rx: Convert to platform remove callback returning void
  media: cdns-csi2tx: Convert to platform remove callback returning void
  media: coda-common: Convert to platform remove callback returning void
  media: pxa_camera: Convert to platform remove callback returning void
  media: m2m-deinterlace: Convert to platform remove callback returning
    void
  media: marvell: Simplify remove callback
  media: marvell: Convert to platform remove callback returning void
  media: mtk_jpeg_core: Convert to platform remove callback returning
    void
  media: mtk_mdp_core: Convert to platform remove callback returning
    void
  media: mtk-mdp3-core: Convert to platform remove callback returning
    void
  media: mtk_vcodec_dec_drv: Convert to platform remove callback
    returning void
  media: mtk_vcodec_enc_drv: Convert to platform remove callback
    returning void
  media: mtk_vpu: Convert to platform remove callback returning void
  media: microchip-csi2dc: Convert to platform remove callback returning
    void
  media: microchip-sama5d2-isc: Convert to platform remove callback
    returning void
  media: microchip-sama7g5-isc: Convert to platform remove callback
    returning void
  media: vde: Convert to platform remove callback returning void
  media: dw100: Convert to platform remove callback returning void
  media: mxc-jpeg: Convert to platform remove callback returning void
  media: imx-mipi-csis: Convert to platform remove callback returning
    void
  media: imx-pxp: Convert to platform remove callback returning void
  media: imx7-media-csi: Convert to platform remove callback returning
    void
  media: mx2_emmaprp: Convert to platform remove callback returning void
  media: camss: Convert to platform remove callback returning void
  media: venus: Warn only once about problems in .remove()
  media: venus: Convert to platform remove callback returning void
  media: vdec: Convert to platform remove callback returning void
  media: venc: Convert to platform remove callback returning void
  media: rcar-fcp: Convert to platform remove callback returning void
  media: rcar-isp: Convert to platform remove callback returning void
  media: rcar-core: Convert to platform remove callback returning void
  media: rcar-csi2: Convert to platform remove callback returning void
  media: rcar_drif: Convert to platform remove callback returning void
  media: rcar_fdp1: Convert to platform remove callback returning void
  media: rcar_jpu: Convert to platform remove callback returning void
  media: renesas-ceu: Convert to platform remove callback returning void
  media: rzg2l-core: Convert to platform remove callback returning void
  media: rzg2l-csi2: Convert to platform remove callback returning void
  media: sh_vou: Convert to platform remove callback returning void
  media: vsp1_drv: Convert to platform remove callback returning void
  media: rga: Convert to platform remove callback returning void
  media: rkisp1-dev: Convert to platform remove callback returning void
  media: gsc-core: Convert to platform remove callback returning void
  media: fimc-core: Convert to platform remove callback returning void
  media: fimc-is-i2c: Convert to platform remove callback returning void
  media: fimc-is: Convert to platform remove callback returning void
  media: fimc-lite: Convert to platform remove callback returning void
  media: media-dev: Convert to platform remove callback returning void
  media: mipi-csis: Convert to platform remove callback returning void
  media: camif-core: Convert to platform remove callback returning void
  media: g2d: Convert to platform remove callback returning void
  media: jpeg-core: Convert to platform remove callback returning void
  media: s5p_mfc: Convert to platform remove callback returning void
  media: bdisp-v4l2: Convert to platform remove callback returning void
  media: c8sectpfe-core: Convert to platform remove callback returning
    void
  media: delta-v4l2: Convert to platform remove callback returning void
  media: hva-v4l2: Convert to platform remove callback returning void
  media: dma2d: Convert to platform remove callback returning void
  media: stm32-dcmi: Convert to platform remove callback returning void
  media: sun4i_csi: Convert to platform remove callback returning void
  media: sun6i_csi: Convert to platform remove callback returning void
  media: sun6i_mipi_csi2: Convert to platform remove callback returning
    void
  media: sun8i_a83t_mipi_csi2: Convert to platform remove callback
    returning void
  media: sun8i-di: Convert to platform remove callback returning void
  media: sun8i_rotate: Convert to platform remove callback returning
    void
  media: am437x-vpfe: Convert to platform remove callback returning void
  media: cal: Convert to platform remove callback returning void
  media: vpif: Convert to platform remove callback returning void
  media: vpif_capture: Convert to platform remove callback returning
    void
  media: vpif_display: Convert to platform remove callback returning
    void
  media: omap_vout: Convert to platform remove callback returning void
  media: isp: Convert to platform remove callback returning void
  media: vpe: Convert to platform remove callback returning void
  media: hantro_drv: Convert to platform remove callback returning void
  media: via-camera: Convert to platform remove callback returning void
  media: video-mux: Convert to platform remove callback returning void
  media: xilinx-csi2rxss: Convert to platform remove callback returning
    void
  media: xilinx-tpg: Convert to platform remove callback returning void
  media: xilinx-vipp: Convert to platform remove callback returning void
  media: xilinx-vtc: Convert to platform remove callback returning void
  media: radio-si476x: Convert to platform remove callback returning
    void
  media: radio-timb: Convert to platform remove callback returning void
  media: radio-wl1273: Convert to platform remove callback returning
    void
  media: radio-platform-si4713: Convert to platform remove callback
    returning void
  media: gpio-ir-recv: Convert to platform remove callback returning
    void
  media: img-ir-core: Convert to platform remove callback returning void
  media: ir-hix5hd2: Convert to platform remove callback returning void
  media: meson-ir-tx: Convert to platform remove callback returning void
  media: meson-ir: Convert to platform remove callback returning void
  media: mtk-cir: Convert to platform remove callback returning void
  media: st_rc: Convert to platform remove callback returning void
  media: sunxi-cir: Convert to platform remove callback returning void
  media: vicodec-core: Convert to platform remove callback returning
    void
  media: vidtv_bridge: Convert to platform remove callback returning
    void
  media: vim2m: Convert to platform remove callback returning void
  media: vimc-core: Convert to platform remove callback returning void
  media: visl-core: Convert to platform remove callback returning void
  media: vivid-core: Convert to platform remove callback returning void
  media: it913x: Convert to platform remove callback returning void

 drivers/media/cec/platform/cec-gpio/cec-gpio.c   |  5 ++---
 drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 16 ++++++++--------
 drivers/media/cec/platform/meson/ao-cec-g12a.c   |  6 ++----
 drivers/media/cec/platform/meson/ao-cec.c        |  6 ++----
 drivers/media/cec/platform/s5p/s5p_cec.c         |  5 ++---
 drivers/media/cec/platform/seco/seco-cec.c       |  6 ++----
 drivers/media/cec/platform/sti/stih-cec.c        |  6 ++----
 drivers/media/cec/platform/stm32/stm32-cec.c     |  6 ++----
 drivers/media/cec/platform/tegra/tegra_cec.c     |  6 ++----
 drivers/media/dvb-frontends/rtl2832_sdr.c        |  6 ++----
 drivers/media/dvb-frontends/zd1301_demod.c       |  6 ++----
 .../media/platform/allegro-dvt/allegro-core.c    |  6 ++----
 drivers/media/platform/amlogic/meson-ge2d/ge2d.c |  6 ++----
 drivers/media/platform/amphion/vpu_core.c        |  6 ++----
 drivers/media/platform/amphion/vpu_drv.c         |  6 ++----
 drivers/media/platform/aspeed/aspeed-video.c     |  6 ++----
 drivers/media/platform/atmel/atmel-isi.c         |  6 ++----
 drivers/media/platform/cadence/cdns-csi2rx.c     |  6 ++----
 drivers/media/platform/cadence/cdns-csi2tx.c     |  6 ++----
 drivers/media/platform/chips-media/coda-common.c |  5 ++---
 drivers/media/platform/intel/pxa_camera.c        |  6 ++----
 drivers/media/platform/m2m-deinterlace.c         |  6 ++----
 drivers/media/platform/marvell/mmp-driver.c      | 16 +++-------------
 .../media/platform/mediatek/jpeg/mtk_jpeg_core.c |  6 ++----
 .../media/platform/mediatek/mdp/mtk_mdp_core.c   |  5 ++---
 .../media/platform/mediatek/mdp3/mtk-mdp3-core.c |  5 ++---
 .../mediatek/vcodec/mtk_vcodec_dec_drv.c         |  5 ++---
 .../mediatek/vcodec/mtk_vcodec_enc_drv.c         |  5 ++---
 drivers/media/platform/mediatek/vpu/mtk_vpu.c    |  6 ++----
 .../media/platform/microchip/microchip-csi2dc.c  |  6 ++----
 .../platform/microchip/microchip-sama5d2-isc.c   |  6 ++----
 .../platform/microchip/microchip-sama7g5-isc.c   |  6 ++----
 drivers/media/platform/nvidia/tegra-vde/vde.c    |  6 ++----
 drivers/media/platform/nxp/dw100/dw100.c         |  6 ++----
 drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c   |  6 ++----
 drivers/media/platform/nxp/imx-mipi-csis.c       |  6 ++----
 drivers/media/platform/nxp/imx-pxp.c             |  6 ++----
 drivers/media/platform/nxp/imx7-media-csi.c      |  6 ++----
 drivers/media/platform/nxp/mx2_emmaprp.c         |  6 ++----
 drivers/media/platform/qcom/camss/camss.c        |  6 ++----
 drivers/media/platform/qcom/venus/core.c         |  6 ++----
 drivers/media/platform/qcom/venus/vdec.c         |  6 ++----
 drivers/media/platform/qcom/venus/venc.c         |  6 ++----
 drivers/media/platform/renesas/rcar-fcp.c        |  6 ++----
 drivers/media/platform/renesas/rcar-isp.c        |  6 ++----
 .../media/platform/renesas/rcar-vin/rcar-core.c  |  6 ++----
 .../media/platform/renesas/rcar-vin/rcar-csi2.c  |  6 ++----
 drivers/media/platform/renesas/rcar_drif.c       |  8 +++-----
 drivers/media/platform/renesas/rcar_fdp1.c       |  6 ++----
 drivers/media/platform/renesas/rcar_jpu.c        |  6 ++----
 drivers/media/platform/renesas/renesas-ceu.c     |  6 ++----
 .../platform/renesas/rzg2l-cru/rzg2l-core.c      |  6 ++----
 .../platform/renesas/rzg2l-cru/rzg2l-csi2.c      |  6 ++----
 drivers/media/platform/renesas/sh_vou.c          |  5 ++---
 drivers/media/platform/renesas/vsp1/vsp1_drv.c   |  6 ++----
 drivers/media/platform/rockchip/rga/rga.c        |  6 ++----
 .../media/platform/rockchip/rkisp1/rkisp1-dev.c  |  6 ++----
 .../media/platform/samsung/exynos-gsc/gsc-core.c |  5 ++---
 .../platform/samsung/exynos4-is/fimc-core.c      |  5 ++---
 .../platform/samsung/exynos4-is/fimc-is-i2c.c    |  6 ++----
 .../media/platform/samsung/exynos4-is/fimc-is.c  |  6 ++----
 .../platform/samsung/exynos4-is/fimc-lite.c      |  5 ++---
 .../platform/samsung/exynos4-is/media-dev.c      |  8 +++-----
 .../platform/samsung/exynos4-is/mipi-csis.c      |  6 ++----
 .../platform/samsung/s3c-camif/camif-core.c      |  6 ++----
 drivers/media/platform/samsung/s5p-g2d/g2d.c     |  5 ++---
 .../media/platform/samsung/s5p-jpeg/jpeg-core.c  |  6 ++----
 drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c |  5 ++---
 drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c |  6 ++----
 .../platform/st/sti/c8sectpfe/c8sectpfe-core.c   |  6 ++----
 drivers/media/platform/st/sti/delta/delta-v4l2.c |  6 ++----
 drivers/media/platform/st/sti/hva/hva-v4l2.c     |  6 ++----
 drivers/media/platform/st/stm32/dma2d/dma2d.c    |  6 ++----
 drivers/media/platform/st/stm32/stm32-dcmi.c     |  6 ++----
 .../media/platform/sunxi/sun4i-csi/sun4i_csi.c   |  6 ++----
 .../media/platform/sunxi/sun6i-csi/sun6i_csi.c   |  6 ++----
 .../sunxi/sun6i-mipi-csi2/sun6i_mipi_csi2.c      |  6 ++----
 .../sun8i-a83t-mipi-csi2/sun8i_a83t_mipi_csi2.c  |  6 ++----
 drivers/media/platform/sunxi/sun8i-di/sun8i-di.c |  6 ++----
 .../platform/sunxi/sun8i-rotate/sun8i_rotate.c   |  6 ++----
 drivers/media/platform/ti/am437x/am437x-vpfe.c   |  6 ++----
 drivers/media/platform/ti/cal/cal.c              |  6 ++----
 drivers/media/platform/ti/davinci/vpif.c         |  6 ++----
 drivers/media/platform/ti/davinci/vpif_capture.c |  5 ++---
 drivers/media/platform/ti/davinci/vpif_display.c |  6 ++----
 drivers/media/platform/ti/omap/omap_vout.c       |  5 ++---
 drivers/media/platform/ti/omap3isp/isp.c         |  6 ++----
 drivers/media/platform/ti/vpe/vpe.c              |  6 ++----
 drivers/media/platform/verisilicon/hantro_drv.c  |  5 ++---
 drivers/media/platform/via/via-camera.c          |  5 ++---
 drivers/media/platform/video-mux.c               |  6 ++----
 drivers/media/platform/xilinx/xilinx-csi2rxss.c  |  6 ++----
 drivers/media/platform/xilinx/xilinx-tpg.c       |  6 ++----
 drivers/media/platform/xilinx/xilinx-vipp.c      |  6 ++----
 drivers/media/platform/xilinx/xilinx-vtc.c       |  6 ++----
 drivers/media/radio/radio-si476x.c               |  6 ++----
 drivers/media/radio/radio-timb.c                 |  5 ++---
 drivers/media/radio/radio-wl1273.c               |  6 ++----
 .../media/radio/si4713/radio-platform-si4713.c   |  6 ++----
 drivers/media/rc/gpio-ir-recv.c                  |  6 ++----
 drivers/media/rc/img-ir/img-ir-core.c            |  5 ++---
 drivers/media/rc/ir-hix5hd2.c                    |  5 ++---
 drivers/media/rc/meson-ir-tx.c                   |  6 ++----
 drivers/media/rc/meson-ir.c                      |  6 ++----
 drivers/media/rc/mtk-cir.c                       |  6 ++----
 drivers/media/rc/st_rc.c                         |  5 ++---
 drivers/media/rc/sunxi-cir.c                     |  6 ++----
 .../media/test-drivers/vicodec/vicodec-core.c    |  6 ++----
 drivers/media/test-drivers/vidtv/vidtv_bridge.c  |  6 ++----
 drivers/media/test-drivers/vim2m.c               |  6 ++----
 drivers/media/test-drivers/vimc/vimc-core.c      |  6 ++----
 drivers/media/test-drivers/visl/visl-core.c      |  6 ++----
 drivers/media/test-drivers/vivid/vivid-core.c    |  5 ++---
 drivers/media/tuners/it913x.c                    |  6 ++----
 114 files changed, 237 insertions(+), 449 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 047/117] media: rcar-fcp: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:04   ` Geert Uytterhoeven
  2023-03-26 14:31 ` [PATCH 048/117] media: rcar-isp: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar-fcp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-fcp.c b/drivers/media/platform/renesas/rcar-fcp.c
index eb59a3ba6d0f..bcef7b87da7c 100644
--- a/drivers/media/platform/renesas/rcar-fcp.c
+++ b/drivers/media/platform/renesas/rcar-fcp.c
@@ -144,7 +144,7 @@ static int rcar_fcp_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rcar_fcp_remove(struct platform_device *pdev)
+static void rcar_fcp_remove(struct platform_device *pdev)
 {
 	struct rcar_fcp_device *fcp = platform_get_drvdata(pdev);
 
@@ -153,8 +153,6 @@ static int rcar_fcp_remove(struct platform_device *pdev)
 	mutex_unlock(&fcp_lock);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id rcar_fcp_of_match[] = {
@@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);
 
 static struct platform_driver rcar_fcp_platform_driver = {
 	.probe		= rcar_fcp_probe,
-	.remove		= rcar_fcp_remove,
+	.remove_new	= rcar_fcp_remove,
 	.driver		= {
 		.name	= "rcar-fcp",
 		.of_match_table = rcar_fcp_of_match,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 048/117] media: rcar-isp: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-26 14:31 ` [PATCH 047/117] media: rcar-fcp: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:10   ` Geert Uytterhoeven
  2023-03-27  8:48   ` Niklas Söderlund
  2023-03-26 14:31 ` [PATCH 049/117] media: rcar-core: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  9 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar-isp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c
index 10b3474f93a4..27fe71931a04 100644
--- a/drivers/media/platform/renesas/rcar-isp.c
+++ b/drivers/media/platform/renesas/rcar-isp.c
@@ -503,7 +503,7 @@ static int risp_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int risp_remove(struct platform_device *pdev)
+static void risp_remove(struct platform_device *pdev)
 {
 	struct rcar_isp *isp = platform_get_drvdata(pdev);
 
@@ -515,8 +515,6 @@ static int risp_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	mutex_destroy(&isp->lock);
-
-	return 0;
 }
 
 static struct platform_driver rcar_isp_driver = {
@@ -525,7 +523,7 @@ static struct platform_driver rcar_isp_driver = {
 		.of_match_table = risp_of_id_table,
 	},
 	.probe = risp_probe,
-	.remove = risp_remove,
+	.remove_new = risp_remove,
 };
 
 module_platform_driver(rcar_isp_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 049/117] media: rcar-core: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-26 14:31 ` [PATCH 047/117] media: rcar-fcp: " Uwe Kleine-König
  2023-03-26 14:31 ` [PATCH 048/117] media: rcar-isp: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:09   ` Geert Uytterhoeven
  2023-03-27  8:47   ` Niklas Söderlund
  2023-03-26 14:31 ` [PATCH 050/117] media: rcar-csi2: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar-vin/rcar-core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
index 5e53d6b7036c..1398f147e5c2 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
@@ -1442,7 +1442,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rcar_vin_remove(struct platform_device *pdev)
+static void rcar_vin_remove(struct platform_device *pdev)
 {
 	struct rvin_dev *vin = platform_get_drvdata(pdev);
 
@@ -1458,8 +1458,6 @@ static int rcar_vin_remove(struct platform_device *pdev)
 		rvin_parallel_cleanup(vin);
 
 	rvin_dma_unregister(vin);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
@@ -1472,7 +1470,7 @@ static struct platform_driver rcar_vin_driver = {
 		.of_match_table = rvin_of_id_table,
 	},
 	.probe = rcar_vin_probe,
-	.remove = rcar_vin_remove,
+	.remove_new = rcar_vin_remove,
 };
 
 module_platform_driver(rcar_vin_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 050/117] media: rcar-csi2: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 049/117] media: rcar-core: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:13   ` Geert Uytterhoeven
  2023-03-27  8:49   ` Niklas Söderlund
  2023-03-26 14:31 ` [PATCH 051/117] media: rcar_drif: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  9 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Niklas Söderlund, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar-vin/rcar-csi2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
index 174aa6176f54..1632c9a53ac4 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
@@ -1574,7 +1574,7 @@ static int rcsi2_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rcsi2_remove(struct platform_device *pdev)
+static void rcsi2_remove(struct platform_device *pdev)
 {
 	struct rcar_csi2 *priv = platform_get_drvdata(pdev);
 
@@ -1585,12 +1585,10 @@ static int rcsi2_remove(struct platform_device *pdev)
 	pm_runtime_disable(&pdev->dev);
 
 	mutex_destroy(&priv->lock);
-
-	return 0;
 }
 
 static struct platform_driver rcar_csi2_pdrv = {
-	.remove	= rcsi2_remove,
+	.remove_new = rcsi2_remove,
 	.probe	= rcsi2_probe,
 	.driver	= {
 		.name	= "rcar-csi2",
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 051/117] media: rcar_drif: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 050/117] media: rcar-csi2: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:12   ` Geert Uytterhoeven
  2023-03-28 13:54   ` Fabrizio Castro
  2023-03-26 14:31 ` [PATCH 052/117] media: rcar_fdp1: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Fabrizio Castro, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar_drif.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar_drif.c b/drivers/media/platform/renesas/rcar_drif.c
index 3fec41f6e964..3a92f4535c18 100644
--- a/drivers/media/platform/renesas/rcar_drif.c
+++ b/drivers/media/platform/renesas/rcar_drif.c
@@ -1433,19 +1433,17 @@ static int rcar_drif_probe(struct platform_device *pdev)
 }
 
 /* DRIF channel remove */
-static int rcar_drif_remove(struct platform_device *pdev)
+static void rcar_drif_remove(struct platform_device *pdev)
 {
 	struct rcar_drif *ch = platform_get_drvdata(pdev);
 	struct rcar_drif_sdr *sdr = ch->sdr;
 
 	/* Channel 0 will be the SDR instance */
 	if (ch->num)
-		return 0;
+		return;
 
 	/* SDR instance */
 	rcar_drif_sdr_remove(sdr);
-
-	return 0;
 }
 
 /* FIXME: Implement suspend/resume support */
@@ -1476,7 +1474,7 @@ static struct platform_driver rcar_drif_driver = {
 		.pm = &rcar_drif_pm_ops,
 		},
 	.probe = rcar_drif_probe,
-	.remove = rcar_drif_remove,
+	.remove_new = rcar_drif_remove,
 };
 
 module_platform_driver(rcar_drif_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 052/117] media: rcar_fdp1: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 051/117] media: rcar_drif: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:12   ` Geert Uytterhoeven
  2023-03-27  8:39   ` Kieran Bingham
  2023-03-26 14:31 ` [PATCH 053/117] media: rcar_jpu: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  9 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Kieran Bingham, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar_fdp1.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
index 37ecf489d112..d80b3214dfae 100644
--- a/drivers/media/platform/renesas/rcar_fdp1.c
+++ b/drivers/media/platform/renesas/rcar_fdp1.c
@@ -2396,7 +2396,7 @@ static int fdp1_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int fdp1_remove(struct platform_device *pdev)
+static void fdp1_remove(struct platform_device *pdev)
 {
 	struct fdp1_dev *fdp1 = platform_get_drvdata(pdev);
 
@@ -2404,8 +2404,6 @@ static int fdp1_remove(struct platform_device *pdev)
 	video_unregister_device(&fdp1->vfd);
 	v4l2_device_unregister(&fdp1->v4l2_dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
@@ -2441,7 +2439,7 @@ MODULE_DEVICE_TABLE(of, fdp1_dt_ids);
 
 static struct platform_driver fdp1_pdrv = {
 	.probe		= fdp1_probe,
-	.remove		= fdp1_remove,
+	.remove_new	= fdp1_remove,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.of_match_table = fdp1_dt_ids,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 053/117] media: rcar_jpu: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 052/117] media: rcar_fdp1: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:11   ` Geert Uytterhoeven
  2023-03-26 14:31 ` [PATCH 054/117] media: renesas-ceu: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Mikhail Ulyanov, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/rcar_jpu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar_jpu.c b/drivers/media/platform/renesas/rcar_jpu.c
index 2f4377cfbb42..e7f604807825 100644
--- a/drivers/media/platform/renesas/rcar_jpu.c
+++ b/drivers/media/platform/renesas/rcar_jpu.c
@@ -1702,7 +1702,7 @@ static int jpu_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int jpu_remove(struct platform_device *pdev)
+static void jpu_remove(struct platform_device *pdev)
 {
 	struct jpu *jpu = platform_get_drvdata(pdev);
 
@@ -1710,8 +1710,6 @@ static int jpu_remove(struct platform_device *pdev)
 	video_unregister_device(&jpu->vfd_encoder);
 	v4l2_m2m_release(jpu->m2m_dev);
 	v4l2_device_unregister(&jpu->v4l2_dev);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -1746,7 +1744,7 @@ static const struct dev_pm_ops jpu_pm_ops = {
 
 static struct platform_driver jpu_driver = {
 	.probe = jpu_probe,
-	.remove = jpu_remove,
+	.remove_new = jpu_remove,
 	.driver = {
 		.of_match_table = jpu_dt_ids,
 		.name = DRV_NAME,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 054/117] media: renesas-ceu: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 053/117] media: rcar_jpu: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:13   ` Geert Uytterhoeven
  2023-03-26 14:31 ` [PATCH 058/117] media: vsp1_drv: " Uwe Kleine-König
  2023-04-17  6:02 ` [PATCH 000/117] media: " Uwe Kleine-König
  9 siblings, 1 reply; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Jacopo Mondi, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/renesas-ceu.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c
index f70f91b006b7..02d1ab23d76d 100644
--- a/drivers/media/platform/renesas/renesas-ceu.c
+++ b/drivers/media/platform/renesas/renesas-ceu.c
@@ -1709,7 +1709,7 @@ static int ceu_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ceu_remove(struct platform_device *pdev)
+static void ceu_remove(struct platform_device *pdev)
 {
 	struct ceu_device *ceudev = platform_get_drvdata(pdev);
 
@@ -1722,8 +1722,6 @@ static int ceu_remove(struct platform_device *pdev)
 	v4l2_device_unregister(&ceudev->v4l2_dev);
 
 	video_unregister_device(&ceudev->vdev);
-
-	return 0;
 }
 
 static const struct dev_pm_ops ceu_pm_ops = {
@@ -1739,7 +1737,7 @@ static struct platform_driver ceu_driver = {
 		.of_match_table = of_match_ptr(ceu_of_match),
 	},
 	.probe		= ceu_probe,
-	.remove		= ceu_remove,
+	.remove_new	= ceu_remove,
 };
 
 module_platform_driver(ceu_driver);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 058/117] media: vsp1_drv: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 054/117] media: renesas-ceu: " Uwe Kleine-König
@ 2023-03-26 14:31 ` Uwe Kleine-König
  2023-03-27  7:11   ` Geert Uytterhoeven
  2023-03-27  8:41   ` Kieran Bingham
  2023-04-17  6:02 ` [PATCH 000/117] media: " Uwe Kleine-König
  9 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-03-26 14:31 UTC (permalink / raw)
  To: Laurent Pinchart, Kieran Bingham, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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/renesas/vsp1/vsp1_drv.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
index 5710152d6511..c1c28f98bd10 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
@@ -977,7 +977,7 @@ static int vsp1_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int vsp1_remove(struct platform_device *pdev)
+static void vsp1_remove(struct platform_device *pdev)
 {
 	struct vsp1_device *vsp1 = platform_get_drvdata(pdev);
 
@@ -985,8 +985,6 @@ static int vsp1_remove(struct platform_device *pdev)
 	rcar_fcp_put(vsp1->fcp);
 
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 static const struct of_device_id vsp1_of_match[] = {
@@ -999,7 +997,7 @@ MODULE_DEVICE_TABLE(of, vsp1_of_match);
 
 static struct platform_driver vsp1_platform_driver = {
 	.probe		= vsp1_probe,
-	.remove		= vsp1_remove,
+	.remove_new	= vsp1_remove,
 	.driver		= {
 		.name	= "vsp1",
 		.pm	= &vsp1_pm_ops,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 047/117] media: rcar-fcp: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 047/117] media: rcar-fcp: " Uwe Kleine-König
@ 2023-03-27  7:04   ` Geert Uytterhoeven
  0 siblings, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:04 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 049/117] media: rcar-core: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 049/117] media: rcar-core: " Uwe Kleine-König
@ 2023-03-27  7:09   ` Geert Uytterhoeven
  2023-03-27  8:47   ` Niklas Söderlund
  1 sibling, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:09 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 048/117] media: rcar-isp: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 048/117] media: rcar-isp: " Uwe Kleine-König
@ 2023-03-27  7:10   ` Geert Uytterhoeven
  2023-03-27  8:48   ` Niklas Söderlund
  1 sibling, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:10 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 053/117] media: rcar_jpu: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 053/117] media: rcar_jpu: " Uwe Kleine-König
@ 2023-03-27  7:11   ` Geert Uytterhoeven
  0 siblings, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:11 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mikhail Ulyanov, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 058/117] media: vsp1_drv: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 058/117] media: vsp1_drv: " Uwe Kleine-König
@ 2023-03-27  7:11   ` Geert Uytterhoeven
  2023-03-27  8:41   ` Kieran Bingham
  1 sibling, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:11 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Laurent Pinchart, Kieran Bingham, Mauro Carvalho Chehab,
	linux-media, linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 051/117] media: rcar_drif: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 051/117] media: rcar_drif: " Uwe Kleine-König
@ 2023-03-27  7:12   ` Geert Uytterhoeven
  2023-03-28 13:54   ` Fabrizio Castro
  1 sibling, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Fabrizio Castro, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 052/117] media: rcar_fdp1: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 052/117] media: rcar_fdp1: " Uwe Kleine-König
@ 2023-03-27  7:12   ` Geert Uytterhoeven
  2023-03-27  8:39   ` Kieran Bingham
  1 sibling, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:12 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Kieran Bingham, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 054/117] media: renesas-ceu: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 054/117] media: renesas-ceu: " Uwe Kleine-König
@ 2023-03-27  7:13   ` Geert Uytterhoeven
  0 siblings, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:13 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Jacopo Mondi, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:33 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 050/117] media: rcar-csi2: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 050/117] media: rcar-csi2: " Uwe Kleine-König
@ 2023-03-27  7:13   ` Geert Uytterhoeven
  2023-03-27  8:49   ` Niklas Söderlund
  1 sibling, 0 replies; 31+ messages in thread
From: Geert Uytterhoeven @ 2023-03-27  7:13 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Niklas Söderlund, Mauro Carvalho Chehab, linux-media,
	linux-renesas-soc, kernel

On Sun, Mar 26, 2023 at 4:34 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: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 052/117] media: rcar_fdp1: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 052/117] media: rcar_fdp1: " Uwe Kleine-König
  2023-03-27  7:12   ` Geert Uytterhoeven
@ 2023-03-27  8:39   ` Kieran Bingham
  1 sibling, 0 replies; 31+ messages in thread
From: Kieran Bingham @ 2023-03-27  8:39 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Uwe Kleine-König
  Cc: linux-media, linux-renesas-soc, kernel

Quoting Uwe Kleine-König (2023-03-26 15:31:19)
> 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: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/rcar_fdp1.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_fdp1.c b/drivers/media/platform/renesas/rcar_fdp1.c
> index 37ecf489d112..d80b3214dfae 100644
> --- a/drivers/media/platform/renesas/rcar_fdp1.c
> +++ b/drivers/media/platform/renesas/rcar_fdp1.c
> @@ -2396,7 +2396,7 @@ static int fdp1_probe(struct platform_device *pdev)
>         return ret;
>  }
>  
> -static int fdp1_remove(struct platform_device *pdev)
> +static void fdp1_remove(struct platform_device *pdev)
>  {
>         struct fdp1_dev *fdp1 = platform_get_drvdata(pdev);
>  
> @@ -2404,8 +2404,6 @@ static int fdp1_remove(struct platform_device *pdev)
>         video_unregister_device(&fdp1->vfd);
>         v4l2_device_unregister(&fdp1->v4l2_dev);
>         pm_runtime_disable(&pdev->dev);
> -
> -       return 0;
>  }
>  
>  static int __maybe_unused fdp1_pm_runtime_suspend(struct device *dev)
> @@ -2441,7 +2439,7 @@ MODULE_DEVICE_TABLE(of, fdp1_dt_ids);
>  
>  static struct platform_driver fdp1_pdrv = {
>         .probe          = fdp1_probe,
> -       .remove         = fdp1_remove,
> +       .remove_new     = fdp1_remove,
>         .driver         = {
>                 .name   = DRIVER_NAME,
>                 .of_match_table = fdp1_dt_ids,
> -- 
> 2.39.2
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 058/117] media: vsp1_drv: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 058/117] media: vsp1_drv: " Uwe Kleine-König
  2023-03-27  7:11   ` Geert Uytterhoeven
@ 2023-03-27  8:41   ` Kieran Bingham
  1 sibling, 0 replies; 31+ messages in thread
From: Kieran Bingham @ 2023-03-27  8:41 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab, Uwe Kleine-König
  Cc: linux-media, linux-renesas-soc, kernel

Quoting Uwe Kleine-König (2023-03-26 15:31:25)
> 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: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

> ---
>  drivers/media/platform/renesas/vsp1/vsp1_drv.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drv.c b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> index 5710152d6511..c1c28f98bd10 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_drv.c
> @@ -977,7 +977,7 @@ static int vsp1_probe(struct platform_device *pdev)
>         return ret;
>  }
>  
> -static int vsp1_remove(struct platform_device *pdev)
> +static void vsp1_remove(struct platform_device *pdev)
>  {
>         struct vsp1_device *vsp1 = platform_get_drvdata(pdev);
>  
> @@ -985,8 +985,6 @@ static int vsp1_remove(struct platform_device *pdev)
>         rcar_fcp_put(vsp1->fcp);
>  
>         pm_runtime_disable(&pdev->dev);
> -
> -       return 0;
>  }
>  
>  static const struct of_device_id vsp1_of_match[] = {
> @@ -999,7 +997,7 @@ MODULE_DEVICE_TABLE(of, vsp1_of_match);
>  
>  static struct platform_driver vsp1_platform_driver = {
>         .probe          = vsp1_probe,
> -       .remove         = vsp1_remove,
> +       .remove_new     = vsp1_remove,
>         .driver         = {
>                 .name   = "vsp1",
>                 .pm     = &vsp1_pm_ops,
> -- 
> 2.39.2
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 049/117] media: rcar-core: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 049/117] media: rcar-core: " Uwe Kleine-König
  2023-03-27  7:09   ` Geert Uytterhoeven
@ 2023-03-27  8:47   ` Niklas Söderlund
  1 sibling, 0 replies; 31+ messages in thread
From: Niklas Söderlund @ 2023-03-27  8:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mauro Carvalho Chehab, linux-media, linux-renesas-soc, kernel

On 2023-03-26 16:31:16 +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> index 5e53d6b7036c..1398f147e5c2 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -1442,7 +1442,7 @@ static int rcar_vin_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int rcar_vin_remove(struct platform_device *pdev)
> +static void rcar_vin_remove(struct platform_device *pdev)
>  {
>  	struct rvin_dev *vin = platform_get_drvdata(pdev);
>  
> @@ -1458,8 +1458,6 @@ static int rcar_vin_remove(struct platform_device *pdev)
>  		rvin_parallel_cleanup(vin);
>  
>  	rvin_dma_unregister(vin);
> -
> -	return 0;
>  }
>  
>  static SIMPLE_DEV_PM_OPS(rvin_pm_ops, rvin_suspend, rvin_resume);
> @@ -1472,7 +1470,7 @@ static struct platform_driver rcar_vin_driver = {
>  		.of_match_table = rvin_of_id_table,
>  	},
>  	.probe = rcar_vin_probe,
> -	.remove = rcar_vin_remove,
> +	.remove_new = rcar_vin_remove,
>  };
>  
>  module_platform_driver(rcar_vin_driver);
> -- 
> 2.39.2
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 048/117] media: rcar-isp: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 048/117] media: rcar-isp: " Uwe Kleine-König
  2023-03-27  7:10   ` Geert Uytterhoeven
@ 2023-03-27  8:48   ` Niklas Söderlund
  1 sibling, 0 replies; 31+ messages in thread
From: Niklas Söderlund @ 2023-03-27  8:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mauro Carvalho Chehab, linux-media, linux-renesas-soc, kernel

On 2023-03-26 16:31:15 +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/platform/renesas/rcar-isp.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c
> index 10b3474f93a4..27fe71931a04 100644
> --- a/drivers/media/platform/renesas/rcar-isp.c
> +++ b/drivers/media/platform/renesas/rcar-isp.c
> @@ -503,7 +503,7 @@ static int risp_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int risp_remove(struct platform_device *pdev)
> +static void risp_remove(struct platform_device *pdev)
>  {
>  	struct rcar_isp *isp = platform_get_drvdata(pdev);
>  
> @@ -515,8 +515,6 @@ static int risp_remove(struct platform_device *pdev)
>  	pm_runtime_disable(&pdev->dev);
>  
>  	mutex_destroy(&isp->lock);
> -
> -	return 0;
>  }
>  
>  static struct platform_driver rcar_isp_driver = {
> @@ -525,7 +523,7 @@ static struct platform_driver rcar_isp_driver = {
>  		.of_match_table = risp_of_id_table,
>  	},
>  	.probe = risp_probe,
> -	.remove = risp_remove,
> +	.remove_new = risp_remove,
>  };
>  
>  module_platform_driver(rcar_isp_driver);
> -- 
> 2.39.2
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 050/117] media: rcar-csi2: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 050/117] media: rcar-csi2: " Uwe Kleine-König
  2023-03-27  7:13   ` Geert Uytterhoeven
@ 2023-03-27  8:49   ` Niklas Söderlund
  1 sibling, 0 replies; 31+ messages in thread
From: Niklas Söderlund @ 2023-03-27  8:49 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mauro Carvalho Chehab, linux-media, linux-renesas-soc, kernel

On 2023-03-26 16:31:17 +0200, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-csi2.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
> index 174aa6176f54..1632c9a53ac4 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
> @@ -1574,7 +1574,7 @@ static int rcsi2_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int rcsi2_remove(struct platform_device *pdev)
> +static void rcsi2_remove(struct platform_device *pdev)
>  {
>  	struct rcar_csi2 *priv = platform_get_drvdata(pdev);
>  
> @@ -1585,12 +1585,10 @@ static int rcsi2_remove(struct platform_device *pdev)
>  	pm_runtime_disable(&pdev->dev);
>  
>  	mutex_destroy(&priv->lock);
> -
> -	return 0;
>  }
>  
>  static struct platform_driver rcar_csi2_pdrv = {
> -	.remove	= rcsi2_remove,
> +	.remove_new = rcsi2_remove,
>  	.probe	= rcsi2_probe,
>  	.driver	= {
>  		.name	= "rcar-csi2",
> -- 
> 2.39.2
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: [PATCH 051/117] media: rcar_drif: Convert to platform remove callback returning void
  2023-03-26 14:31 ` [PATCH 051/117] media: rcar_drif: " Uwe Kleine-König
  2023-03-27  7:12   ` Geert Uytterhoeven
@ 2023-03-28 13:54   ` Fabrizio Castro
  1 sibling, 0 replies; 31+ messages in thread
From: Fabrizio Castro @ 2023-03-28 13:54 UTC (permalink / raw)
  To: Uwe Kleine-König, Mauro Carvalho Chehab
  Cc: linux-media, linux-renesas-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>

Reviewed-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com>


> ---
>  drivers/media/platform/renesas/rcar_drif.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar_drif.c
> b/drivers/media/platform/renesas/rcar_drif.c
> index 3fec41f6e964..3a92f4535c18 100644
> --- a/drivers/media/platform/renesas/rcar_drif.c
> +++ b/drivers/media/platform/renesas/rcar_drif.c
> @@ -1433,19 +1433,17 @@ static int rcar_drif_probe(struct
> platform_device *pdev)
>  }
> 
>  /* DRIF channel remove */
> -static int rcar_drif_remove(struct platform_device *pdev)
> +static void rcar_drif_remove(struct platform_device *pdev)
>  {
>  	struct rcar_drif *ch = platform_get_drvdata(pdev);
>  	struct rcar_drif_sdr *sdr = ch->sdr;
> 
>  	/* Channel 0 will be the SDR instance */
>  	if (ch->num)
> -		return 0;
> +		return;
> 
>  	/* SDR instance */
>  	rcar_drif_sdr_remove(sdr);
> -
> -	return 0;
>  }
> 
>  /* FIXME: Implement suspend/resume support */
> @@ -1476,7 +1474,7 @@ static struct platform_driver rcar_drif_driver =
> {
>  		.pm = &rcar_drif_pm_ops,
>  		},
>  	.probe = rcar_drif_probe,
> -	.remove = rcar_drif_remove,
> +	.remove_new = rcar_drif_remove,
>  };
> 
>  module_platform_driver(rcar_drif_driver);
> --
> 2.39.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 000/117] media: Convert to platform remove callback returning void
  2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-03-26 14:31 ` [PATCH 058/117] media: vsp1_drv: " Uwe Kleine-König
@ 2023-04-17  6:02 ` Uwe Kleine-König
  2023-04-17  6:19   ` Laurent Pinchart
  9 siblings, 1 reply; 31+ messages in thread
From: Uwe Kleine-König @ 2023-04-17  6:02 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-aspeed, Alim Akhtar, Hans Verkuil, Benson Leung,
	Ajye Huang, Rory Liu, Scott Chao, Neil Armstrong, Kevin Hilman,
	Marek Szyprowski, Ettore Chimenti, Alain Volmat, Maxime Coquelin,
	Alexandre Torgue, Sean Young, Sakari Ailus, Ricardo Ribalda,
	Laurent Pinchart, Yang Yingliang, Thierry Reding,
	Jonathan Hunter, Antti Palosaari, Michael Tretter, Ming Qian,
	Zhou Peng, Eddie James, Joel Stanley, Eugen Hristev,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Ripard,
	Philipp Zabel, Bin Liu, Matthias Brugger, Minghsiu Tsai,
	Houlong Wei, Andrew-CT Chen, Moudy Ho, Qiheng Lin, Tiffany Lin,
	Yunfei Dong, Dmitry Osipenko, Xavier Roumegue, Mirela Rabulea,
	Shawn Guo, Sascha Hauer, Rui Miguel Silva, Robert Foss,
	Todor Tomov, Andy Gross, Bjorn Andersson, Stanimir Varbanov,
	Vikash Garodia, Niklas Söderlund, Fabrizio Castro,
	Kieran Bingham, Mikhail Ulyanov, Jacopo Mondi, Lad Prabhakar,
	Nathan Chancellor, Yang Li, Dan Carpenter, Jacob Chen,
	Ezequiel Garcia, Heiko Stuebner, Dafna Hirschfeld,
	Krzysztof Kozlowski, Colin Ian King, Sylwester Nawrocki,
	Sylwester Nawrocki, Łukasz Stelmach, Andrzej Pietrasiewicz,
	Jacek Anaszewski, Andrzej Hajda, Fabien Dessenne,
	Patrice Chotard, Hugues Fruchet, Jean-Christophe Trotin,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Yong Deng,
	Paul Kocialkowski, Christophe JAILLET, Lad, Prabhakar,
	Benoit Parrot, Hyun Kwon, Michal Simek, ye xingchen,
	Eduardo Valentin, Sean Wang, Daniel W. S. Almeida, Shuah Khan,
	Daniel Almeida, Hans Verkuil, Guenter Roeck, Fabio Estevam,
	linux-stm32, Jerome Brunet, chrome-platform, linux-samsung-soc,
	Konrad Dybcio, openbmc, Kieran Bingham, linux-rockchip,
	NXP Linux Team, linux-sunxi, linux-media, Martin Blumenstingl,
	linux-arm-msm, linux-mediatek, linux-tegra, linux-amlogic,
	linux-arm-kernel, AngeloGioacchino Del Regno, Andrew Jeffery,
	linux-renesas-soc, kernel

[-- Attachment #1: Type: text/plain, Size: 1863 bytes --]

Hello Mauro

On Sun, Mar 26, 2023 at 04:30:25PM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> this series adapts the platform drivers below drivers/pci to use the

copy&paste failure here: s/pci/media/ of course.

> .remove_new() callback. Compared to the traditional .remove() callback
> .remove_new() returns no value. This is a good thing because the driver core
> doesn't (and cannot) cope for errors during remove. The only effect of a
> non-zero return value in .remove() is that the driver core emits a warning. The
> device is removed anyhow and an early return from .remove() usually yields a
> resource leak.
> 
> By changing the remove callback to return void driver authors cannot
> reasonably assume any more that there is some kind of cleanup later.
> 
> Only three drivers needed some preparation first to make sure they
> return 0 unconditionally in their remove callback. Then all drivers
> could be trivially converted without side effects to .remove_new().
> 
> The changes to the individual drivers are all orthogonal. If I need to
> resend some patches because of some review feedback, I'd like to only
> send the patches that actually needed changes, so please pick up the
> remaining patches that don't need changing to reduce the amount of mail.

I didn't hear anything back about application of this series. Is there a
blocker somewhere?

Apart from the three preparatory patches that are a precondition to the
conversion of the respective drivers, the patches are all pairwise
orthogonal. So from my POV the best would be to apply all patches that
still apply (which might be all), I will care for the fallout later
then.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 000/117] media: Convert to platform remove callback returning void
  2023-04-17  6:02 ` [PATCH 000/117] media: " Uwe Kleine-König
@ 2023-04-17  6:19   ` Laurent Pinchart
  2023-04-17  7:30     ` Uwe Kleine-König
  0 siblings, 1 reply; 31+ messages in thread
From: Laurent Pinchart @ 2023-04-17  6:19 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Mauro Carvalho Chehab, linux-aspeed, Alim Akhtar, Hans Verkuil,
	Benson Leung, Ajye Huang, Rory Liu, Scott Chao, Neil Armstrong,
	Kevin Hilman, Marek Szyprowski, Ettore Chimenti, Alain Volmat,
	Maxime Coquelin, Alexandre Torgue, Sean Young, Sakari Ailus,
	Ricardo Ribalda, Yang Yingliang, Thierry Reding, Jonathan Hunter,
	Antti Palosaari, Michael Tretter, Ming Qian, Zhou Peng,
	Eddie James, Joel Stanley, Eugen Hristev, Nicolas Ferre,
	Alexandre Belloni, Claudiu Beznea, Maxime Ripard, Philipp Zabel,
	Bin Liu, Matthias Brugger, Minghsiu Tsai, Houlong Wei,
	Andrew-CT Chen, Moudy Ho, Qiheng Lin, Tiffany Lin, Yunfei Dong,
	Dmitry Osipenko, Xavier Roumegue, Mirela Rabulea, Shawn Guo,
	Sascha Hauer, Rui Miguel Silva, Robert Foss, Todor Tomov,
	Andy Gross, Bjorn Andersson, Stanimir Varbanov, Vikash Garodia,
	Niklas Söderlund, Fabrizio Castro, Kieran Bingham,
	Mikhail Ulyanov, Jacopo Mondi, Lad Prabhakar, Nathan Chancellor,
	Yang Li, Dan Carpenter, Jacob Chen, Ezequiel Garcia,
	Heiko Stuebner, Dafna Hirschfeld, Krzysztof Kozlowski,
	Colin Ian King, Sylwester Nawrocki, Sylwester Nawrocki,
	Łukasz Stelmach, Andrzej Pietrasiewicz, Jacek Anaszewski,
	Andrzej Hajda, Fabien Dessenne, Patrice Chotard, Hugues Fruchet,
	Jean-Christophe Trotin, Chen-Yu Tsai, Jernej Skrabec,
	Samuel Holland, Yong Deng, Paul Kocialkowski, Christophe JAILLET,
	Lad, Prabhakar, Benoit Parrot, Hyun Kwon, Michal Simek,
	ye xingchen, Eduardo Valentin, Sean Wang, Daniel W. S. Almeida,
	Shuah Khan, Daniel Almeida, Hans Verkuil, Guenter Roeck,
	Fabio Estevam, linux-stm32, Jerome Brunet, chrome-platform,
	linux-samsung-soc, Konrad Dybcio, openbmc, Kieran Bingham,
	linux-rockchip, NXP Linux Team, linux-sunxi, linux-media,
	Martin Blumenstingl, linux-arm-msm, linux-mediatek, linux-tegra,
	linux-amlogic, linux-arm-kernel, AngeloGioacchino Del Regno,
	Andrew Jeffery, linux-renesas-soc, kernel

Hi Uwe,

On Mon, Apr 17, 2023 at 08:02:03AM +0200, Uwe Kleine-König wrote:
> Hello Mauro
> 
> On Sun, Mar 26, 2023 at 04:30:25PM +0200, Uwe Kleine-König wrote:
> > Hello,
> > 
> > this series adapts the platform drivers below drivers/pci to use the
> 
> copy&paste failure here: s/pci/media/ of course.
> 
> > .remove_new() callback. Compared to the traditional .remove() callback
> > .remove_new() returns no value. This is a good thing because the driver core
> > doesn't (and cannot) cope for errors during remove. The only effect of a
> > non-zero return value in .remove() is that the driver core emits a warning. The
> > device is removed anyhow and an early return from .remove() usually yields a
> > resource leak.
> > 
> > By changing the remove callback to return void driver authors cannot
> > reasonably assume any more that there is some kind of cleanup later.
> > 
> > Only three drivers needed some preparation first to make sure they
> > return 0 unconditionally in their remove callback. Then all drivers
> > could be trivially converted without side effects to .remove_new().
> > 
> > The changes to the individual drivers are all orthogonal. If I need to
> > resend some patches because of some review feedback, I'd like to only
> > send the patches that actually needed changes, so please pick up the
> > remaining patches that don't need changing to reduce the amount of mail.
> 
> I didn't hear anything back about application of this series. Is there a
> blocker somewhere?

I think the series got applied to the master branch of
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git.
It should thus appear in v6.4.

The corresponding series for staging media drivers has also been applied
to the same branch as far as I can tell.

> Apart from the three preparatory patches that are a precondition to the
> conversion of the respective drivers, the patches are all pairwise
> orthogonal. So from my POV the best would be to apply all patches that
> still apply (which might be all), I will care for the fallout later
> then.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 000/117] media: Convert to platform remove callback returning void
  2023-04-17  6:19   ` Laurent Pinchart
@ 2023-04-17  7:30     ` Uwe Kleine-König
  2023-04-17  7:35       ` Laurent Pinchart
  2023-04-17  7:57       ` Biju Das
  0 siblings, 2 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-04-17  7:30 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Heiko Stuebner, Eddie James, Hans Verkuil, Alim Akhtar,
	Dmitry Osipenko, linux-stm32, Marek Szyprowski,
	linux-samsung-soc, Robert Foss, Dafna Hirschfeld, Samuel Holland,
	Kevin Hilman, Michal Simek, Antti Palosaari, NXP Linux Team,
	Jerome Brunet, linux-sunxi, ye xingchen, Sascha Hauer,
	Łukasz Stelmach, Eugen Hristev, Shuah Khan, Hyun Kwon,
	Andrew Jeffery, Michael Tretter, Moudy Ho, kernel, Hans Verkuil,
	Claudiu Beznea, Ming Qian, Andrew-CT Chen, Alexandre Belloni,
	Sylwester Nawrocki, linux-aspeed, Yunfei Dong, Lad, Prabhakar,
	Thierry Reding, Guenter Roeck, chrome-platform, Jonathan Hunter,
	linux-rockchip, Fabien Dessenne, Ezequiel Garcia, Alain Volmat,
	Andrzej Pietrasiewicz, Colin Ian King, linux-media, Jacopo Mondi,
	Rory Liu, Martin Blumenstingl, linux-arm-msm, Sean Wang,
	Maxime Ripard, Fabrizio Castro, linux-amlogic, linux-arm-kernel,
	Neil Armstrong, Zhou Peng, Paul Kocialkowski, Maxime Coquelin,
	linux-mediatek, Jacek Anaszewski, Dan Carpenter, Sean Young,
	Xavier Roumegue, Ettore Chimenti, Vikash Garodia, linux-tegra,
	Eduardo Valentin, Andrzej Hajda, Fabio Estevam,
	Jean-Christophe Trotin, Stanimir Varbanov, Kieran Bingham,
	Jernej Skrabec, Chen-Yu Tsai, Jacob Chen, Joel Stanley,
	Yang Yingliang, Patrice Chotard, Bin Liu, Nathan Chancellor,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Benson Leung,
	Daniel W. S. Almeida, Qiheng Lin, Konrad Dybcio, Kieran Bingham,
	Yang Li, Sakari Ailus, Ricardo Ribalda, Shawn Guo, Minghsiu Tsai,
	Daniel Almeida, Alexandre Torgue, Todor Tomov, Mirela Rabulea,
	Ajye Huang, Scott Chao, linux-renesas-soc, Hugues Fruchet,
	openbmc, Andy Gross, Mikhail Ulyanov, Lad Prabhakar,
	Benoit Parrot, Rui Miguel Silva, Christophe JAILLET, Yong Deng,
	Matthias Brugger, Tiffany Lin, AngeloGioacchino Del Regno,
	Bjorn Andersson, Nicolas Ferre, Houlong Wei, Krzysztof Kozlowski,
	Philipp Zabel, Niklas Söderlund

[-- Attachment #1: Type: text/plain, Size: 2324 bytes --]

Hello Laurent,

On Mon, Apr 17, 2023 at 09:19:28AM +0300, Laurent Pinchart wrote:
> On Mon, Apr 17, 2023 at 08:02:03AM +0200, Uwe Kleine-König wrote:
> > On Sun, Mar 26, 2023 at 04:30:25PM +0200, Uwe Kleine-König wrote:
> > > Hello,
> > > 
> > > this series adapts the platform drivers below drivers/pci to use the
> > 
> > copy&paste failure here: s/pci/media/ of course.
> > 
> > > .remove_new() callback. Compared to the traditional .remove() callback
> > > .remove_new() returns no value. This is a good thing because the driver core
> > > doesn't (and cannot) cope for errors during remove. The only effect of a
> > > non-zero return value in .remove() is that the driver core emits a warning. The
> > > device is removed anyhow and an early return from .remove() usually yields a
> > > resource leak.
> > > 
> > > By changing the remove callback to return void driver authors cannot
> > > reasonably assume any more that there is some kind of cleanup later.
> > > 
> > > Only three drivers needed some preparation first to make sure they
> > > return 0 unconditionally in their remove callback. Then all drivers
> > > could be trivially converted without side effects to .remove_new().
> > > 
> > > The changes to the individual drivers are all orthogonal. If I need to
> > > resend some patches because of some review feedback, I'd like to only
> > > send the patches that actually needed changes, so please pick up the
> > > remaining patches that don't need changing to reduce the amount of mail.
> > 
> > I didn't hear anything back about application of this series. Is there a
> > blocker somewhere?
> 
> I think the series got applied to the master branch of
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git.
> It should thus appear in v6.4.

I guess that linux-stable.git is a copy&paste failure (and it's not
there). I don't see the series in the master branch of
git://linuxtv.org/media_tree.git either.

.. a bit later ...

ah, it's in git://linuxtv.org/mchehab/media-next.git

I guess I was just to quick and probably the series will be included in
today's next.

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 000/117] media: Convert to platform remove callback returning void
  2023-04-17  7:30     ` Uwe Kleine-König
@ 2023-04-17  7:35       ` Laurent Pinchart
  2023-04-17  7:57       ` Biju Das
  1 sibling, 0 replies; 31+ messages in thread
From: Laurent Pinchart @ 2023-04-17  7:35 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Heiko Stuebner, Eddie James, Hans Verkuil, Alim Akhtar,
	Dmitry Osipenko, linux-stm32, Marek Szyprowski,
	linux-samsung-soc, Robert Foss, Dafna Hirschfeld, Samuel Holland,
	Kevin Hilman, Michal Simek, Antti Palosaari, NXP Linux Team,
	Jerome Brunet, linux-sunxi, ye xingchen, Sascha Hauer,
	Łukasz Stelmach, Eugen Hristev, Shuah Khan, Hyun Kwon,
	Andrew Jeffery, Michael Tretter, Moudy Ho, kernel, Hans Verkuil,
	Claudiu Beznea, Ming Qian, Andrew-CT Chen, Alexandre Belloni,
	Sylwester Nawrocki, linux-aspeed, Yunfei Dong, Lad, Prabhakar,
	Thierry Reding, Guenter Roeck, chrome-platform, Jonathan Hunter,
	linux-rockchip, Fabien Dessenne, Ezequiel Garcia, Alain Volmat,
	Andrzej Pietrasiewicz, Colin Ian King, linux-media, Jacopo Mondi,
	Rory Liu, Martin Blumenstingl, linux-arm-msm, Sean Wang,
	Maxime Ripard, Fabrizio Castro, linux-amlogic, linux-arm-kernel,
	Neil Armstrong, Zhou Peng, Paul Kocialkowski, Maxime Coquelin,
	linux-mediatek, Jacek Anaszewski, Dan Carpenter, Sean Young,
	Xavier Roumegue, Ettore Chimenti, Vikash Garodia, linux-tegra,
	Eduardo Valentin, Andrzej Hajda, Fabio Estevam,
	Jean-Christophe Trotin, Stanimir Varbanov, Kieran Bingham,
	Jernej Skrabec, Chen-Yu Tsai, Jacob Chen, Joel Stanley,
	Yang Yingliang, Patrice Chotard, Bin Liu, Nathan Chancellor,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Benson Leung,
	Daniel W. S. Almeida, Qiheng Lin, Konrad Dybcio, Kieran Bingham,
	Yang Li, Sakari Ailus, Ricardo Ribalda, Shawn Guo, Minghsiu Tsai,
	Daniel Almeida, Alexandre Torgue, Todor Tomov, Mirela Rabulea,
	Ajye Huang, Scott Chao, linux-renesas-soc, Hugues Fruchet,
	openbmc, Andy Gross, Mikhail Ulyanov, Lad Prabhakar,
	Benoit Parrot, Rui Miguel Silva, Christophe JAILLET, Yong Deng,
	Matthias Brugger, Tiffany Lin, AngeloGioacchino Del Regno,
	Bjorn Andersson, Nicolas Ferre, Houlong Wei, Krzysztof Kozlowski,
	Philipp Zabel, Niklas Söderlund

On Mon, Apr 17, 2023 at 09:30:49AM +0200, Uwe Kleine-König wrote:
> Hello Laurent,
> 
> On Mon, Apr 17, 2023 at 09:19:28AM +0300, Laurent Pinchart wrote:
> > On Mon, Apr 17, 2023 at 08:02:03AM +0200, Uwe Kleine-König wrote:
> > > On Sun, Mar 26, 2023 at 04:30:25PM +0200, Uwe Kleine-König wrote:
> > > > Hello,
> > > > 
> > > > this series adapts the platform drivers below drivers/pci to use the
> > > 
> > > copy&paste failure here: s/pci/media/ of course.
> > > 
> > > > .remove_new() callback. Compared to the traditional .remove() callback
> > > > .remove_new() returns no value. This is a good thing because the driver core
> > > > doesn't (and cannot) cope for errors during remove. The only effect of a
> > > > non-zero return value in .remove() is that the driver core emits a warning. The
> > > > device is removed anyhow and an early return from .remove() usually yields a
> > > > resource leak.
> > > > 
> > > > By changing the remove callback to return void driver authors cannot
> > > > reasonably assume any more that there is some kind of cleanup later.
> > > > 
> > > > Only three drivers needed some preparation first to make sure they
> > > > return 0 unconditionally in their remove callback. Then all drivers
> > > > could be trivially converted without side effects to .remove_new().
> > > > 
> > > > The changes to the individual drivers are all orthogonal. If I need to
> > > > resend some patches because of some review feedback, I'd like to only
> > > > send the patches that actually needed changes, so please pick up the
> > > > remaining patches that don't need changing to reduce the amount of mail.
> > > 
> > > I didn't hear anything back about application of this series. Is there a
> > > blocker somewhere?
> > 
> > I think the series got applied to the master branch of
> > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git.
> > It should thus appear in v6.4.
> 
> I guess that linux-stable.git is a copy&paste failure (and it's not
> there). I don't see the series in the master branch of
> git://linuxtv.org/media_tree.git either.

Oops sorry. It was a copy & paste mistake indeed, I meant

git://linuxtv.org/media_stage.git

> .. a bit later ...
> 
> ah, it's in git://linuxtv.org/mchehab/media-next.git
> 
> I guess I was just to quick and probably the series will be included in
> today's next.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 31+ messages in thread

* RE: [PATCH 000/117] media: Convert to platform remove callback returning void
  2023-04-17  7:30     ` Uwe Kleine-König
  2023-04-17  7:35       ` Laurent Pinchart
@ 2023-04-17  7:57       ` Biju Das
  2023-04-17  8:54         ` Uwe Kleine-König
  1 sibling, 1 reply; 31+ messages in thread
From: Biju Das @ 2023-04-17  7:57 UTC (permalink / raw)
  To: Uwe Kleine-König, Laurent Pinchart
  Cc: Heiko Stuebner, Eddie James, Hans Verkuil, Alim Akhtar,
	Dmitry Osipenko, linux-stm32, Marek Szyprowski,
	linux-samsung-soc, Robert Foss, Dafna Hirschfeld, Samuel Holland,
	Kevin Hilman, Michal Simek, Antti Palosaari, NXP Linux Team,
	Jerome Brunet, linux-sunxi, ye xingchen, Sascha Hauer,
	Łukasz Stelmach, Eugen Hristev, Shuah Khan, Hyun Kwon,
	Andrew Jeffery, Michael Tretter, Moudy Ho, kernel, Hans Verkuil,
	Claudiu Beznea, Ming Qian, Andrew-CT Chen, Alexandre Belloni,
	Sylwester Nawrocki, linux-aspeed, Yunfei Dong, Lad, Prabhakar,
	Thierry Reding, Guenter Roeck, chrome-platform, Jonathan Hunter,
	linux-rockchip, Fabien Dessenne, Ezequiel Garcia, Alain Volmat,
	Andrzej Pietrasiewicz, Colin Ian King, linux-media, Jacopo Mondi,
	Rory Liu, Martin Blumenstingl, linux-arm-msm, Sean Wang,
	Maxime Ripard, Fabrizio Castro, linux-amlogic, linux-arm-kernel,
	Neil Armstrong, Zhou Peng, Paul Kocialkowski, Maxime Coquelin,
	linux-mediatek, Jacek Anaszewski, Dan Carpenter, Sean Young,
	Xavier Roumegue, Ettore Chimenti, Vikash Garodia, linux-tegra,
	Eduardo Valentin, Andrzej Hajda, Fabio Estevam,
	Jean-Christophe Trotin, Stanimir Varbanov, Kieran Bingham,
	Jernej Skrabec, Chen-Yu Tsai, Jacob Chen, Joel Stanley,
	Yang Yingliang, Patrice Chotard, Bin Liu, Nathan Chancellor,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Benson Leung,
	Daniel W. S. Almeida, Qiheng Lin, Konrad Dybcio, Kieran Bingham,
	Yang Li, Sakari Ailus, Ricardo Ribalda, Shawn Guo, Minghsiu Tsai,
	Daniel Almeida, Alexandre Torgue, Todor Tomov, Mirela Rabulea,
	Ajye Huang, Scott Chao, linux-renesas-soc, Hugues Fruchet,
	openbmc, Andy Gross, Mikhail Ulyanov, Prabhakar Mahadev Lad,
	Benoit Parrot, Rui Miguel Silva, Christophe JAILLET, Yong Deng,
	Matthias Brugger, Tiffany Lin, AngeloGioacchino Del Regno,
	Bjorn Andersson, Nicolas Ferre, Houlong Wei, Krzysztof Kozlowski,
	Philipp Zabel, Niklas Söderlund

Hi Uwe,

> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Sent: Monday, April 17, 2023 8:31 AM
> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Heiko Stuebner <heiko@sntech.de>; Eddie James <eajames@linux.ibm.com>;
> Hans Verkuil <hverkuil@xs4all.nl>; Alim Akhtar <alim.akhtar@samsung.com>;
> Dmitry Osipenko <digetx@gmail.com>; linux-stm32@st-md-
> mailman.stormreply.com; Marek Szyprowski <m.szyprowski@samsung.com>; linux-
> samsung-soc@vger.kernel.org; Robert Foss <rfoss@kernel.org>; Dafna
> Hirschfeld <dafna@fastmail.com>; Samuel Holland <samuel@sholland.org>; Kevin
> Hilman <khilman@baylibre.com>; Michal Simek <michal.simek@xilinx.com>; Antti
> Palosaari <crope@iki.fi>; NXP Linux Team <linux-imx@nxp.com>; Jerome Brunet
> <jbrunet@baylibre.com>; linux-sunxi@lists.linux.dev; ye xingchen
> <ye.xingchen@zte.com.cn>; Sascha Hauer <s.hauer@pengutronix.de>; Łukasz
> Stelmach <l.stelmach@samsung.com>; Eugen Hristev
> <eugen.hristev@collabora.com>; Shuah Khan <skhan@linuxfoundation.org>; Hyun
> Kwon <hyun.kwon@xilinx.com>; Andrew Jeffery <andrew@aj.id.au>; Michael
> Tretter <m.tretter@pengutronix.de>; Moudy Ho <moudy.ho@mediatek.com>;
> kernel@pengutronix.de; Hans Verkuil <hverkuil-cisco@xs4all.nl>; Claudiu
> Beznea <claudiu.beznea@microchip.com>; Ming Qian <ming.qian@nxp.com>;
> Andrew-CT Chen <andrew-ct.chen@mediatek.com>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Sylwester Nawrocki
> <s.nawrocki@samsung.com>; linux-aspeed@lists.ozlabs.org; Yunfei Dong
> <yunfei.dong@mediatek.com>; Lad, Prabhakar <prabhakar.csengg@gmail.com>;
> Thierry Reding <thierry.reding@gmail.com>; Guenter Roeck
> <groeck@chromium.org>; chrome-platform@lists.linux.dev; Jonathan Hunter
> <jonathanh@nvidia.com>; linux-rockchip@lists.infradead.org; Fabien Dessenne
> <fabien.dessenne@foss.st.com>; Ezequiel Garcia
> <ezequiel@vanguardiasur.com.ar>; Alain Volmat <alain.volmat@foss.st.com>;
> Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>; Colin Ian King
> <colin.i.king@gmail.com>; linux-media@vger.kernel.org; Jacopo Mondi
> <jacopo@jmondi.org>; Rory Liu <hellojacky0226@hotmail.com>; Martin
> Blumenstingl <martin.blumenstingl@googlemail.com>; linux-arm-
> msm@vger.kernel.org; Sean Wang <sean.wang@mediatek.com>; Maxime Ripard
> <mripard@kernel.org>; Fabrizio Castro <fabrizio.castro.jz@renesas.com>;
> linux-amlogic@lists.infradead.org; linux-arm-kernel@lists.infradead.org;
> Neil Armstrong <neil.armstrong@linaro.org>; Zhou Peng <eagle.zhou@nxp.com>;
> Paul Kocialkowski <paul.kocialkowski@bootlin.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; linux-mediatek@lists.infradead.org; Jacek
> Anaszewski <jacek.anaszewski@gmail.com>; Dan Carpenter <error27@gmail.com>;
> Sean Young <sean@mess.org>; Xavier Roumegue <xavier.roumegue@oss.nxp.com>;
> Ettore Chimenti <ek5.chimenti@gmail.com>; Vikash Garodia
> <quic_vgarodia@quicinc.com>; linux-tegra@vger.kernel.org; Eduardo Valentin
> <edubezval@gmail.com>; Andrzej Hajda <andrzej.hajda@intel.com>; Fabio
> Estevam <festevam@gmail.com>; Jean-Christophe Trotin <jean-
> christophe.trotin@foss.st.com>; Stanimir Varbanov
> <stanimir.k.varbanov@gmail.com>; Kieran Bingham
> <kieran.bingham@ideasonboard.com>; Jernej Skrabec
> <jernej.skrabec@gmail.com>; Chen-Yu Tsai <wens@csie.org>; Jacob Chen <jacob-
> chen@iotwrt.com>; Joel Stanley <joel@jms.id.au>; Yang Yingliang
> <yangyingliang@huawei.com>; Patrice Chotard <patrice.chotard@foss.st.com>;
> Bin Liu <bin.liu@mediatek.com>; Nathan Chancellor <nathan@kernel.org>;
> Sylwester Nawrocki <sylvester.nawrocki@gmail.com>; Mauro Carvalho Chehab
> <mchehab@kernel.org>; Benson Leung <bleung@chromium.org>; Daniel W. S.
> Almeida <dwlsalmeida@gmail.com>; Qiheng Lin <linqiheng@huawei.com>; Konrad
> Dybcio <konrad.dybcio@linaro.org>; Kieran Bingham
> <kieran.bingham+renesas@ideasonboard.com>; Yang Li
> <yang.lee@linux.alibaba.com>; Sakari Ailus <sakari.ailus@linux.intel.com>;
> Ricardo Ribalda <ribalda@chromium.org>; Shawn Guo <shawnguo@kernel.org>;
> Minghsiu Tsai <minghsiu.tsai@mediatek.com>; Daniel Almeida
> <daniel.almeida@collabora.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Todor Tomov <todor.too@gmail.com>; Mirela
> Rabulea <mirela.rabulea@nxp.com>; Ajye Huang <ajye_huang@compal.corp-
> partner.google.com>; Scott Chao <scott_chao@wistron.corp-
> partner.google.com>; linux-renesas-soc@vger.kernel.org; Hugues Fruchet
> <hugues.fruchet@foss.st.com>; openbmc@lists.ozlabs.org; Andy Gross
> <agross@kernel.org>; Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>;
> Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; Benoit
> Parrot <bparrot@ti.com>; Rui Miguel Silva <rmfrfs@gmail.com>; Christophe
> JAILLET <christophe.jaillet@wanadoo.fr>; Yong Deng <yong.deng@magewell.com>;
> Matthias Brugger <matthias.bgg@gmail.com>; Tiffany Lin
> <tiffany.lin@mediatek.com>; AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com>; Bjorn Andersson
> <andersson@kernel.org>; Nicolas Ferre <nicolas.ferre@microchip.com>; Houlong
> Wei <houlong.wei@mediatek.com>; Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org>; Philipp Zabel <p.zabel@pengutronix.de>;
> Niklas Söderlund <niklas.soderlund@ragnatech.se>
> Subject: Re: [PATCH 000/117] media: Convert to platform remove callback
> returning void
> 
> Hello Laurent,
> 
> On Mon, Apr 17, 2023 at 09:19:28AM +0300, Laurent Pinchart wrote:
> > On Mon, Apr 17, 2023 at 08:02:03AM +0200, Uwe Kleine-König wrote:
> > > On Sun, Mar 26, 2023 at 04:30:25PM +0200, Uwe Kleine-König wrote:
> > > > Hello,
> > > >
> > > > this series adapts the platform drivers below drivers/pci to use
> > > > the
> > >
> > > copy&paste failure here: s/pci/media/ of course.
> > >
> > > > .remove_new() callback. Compared to the traditional .remove()
> > > > callback
> > > > .remove_new() returns no value. This is a good thing because the
> > > > driver core doesn't (and cannot) cope for errors during remove.
> > > > The only effect of a non-zero return value in .remove() is that
> > > > the driver core emits a warning. The device is removed anyhow and
> > > > an early return from .remove() usually yields a resource leak.
> > > >
> > > > By changing the remove callback to return void driver authors
> > > > cannot reasonably assume any more that there is some kind of cleanup
> later.
> > > >
> > > > Only three drivers needed some preparation first to make sure they
> > > > return 0 unconditionally in their remove callback. Then all
> > > > drivers could be trivially converted without side effects to
> .remove_new().
> > > >
> > > > The changes to the individual drivers are all orthogonal. If I
> > > > need to resend some patches because of some review feedback, I'd
> > > > like to only send the patches that actually needed changes, so
> > > > please pick up the remaining patches that don't need changing to
> reduce the amount of mail.
> > >
> > > I didn't hear anything back about application of this series. Is
> > > there a blocker somewhere?
> >
> > I think the series got applied to the master branch of
> > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git.
> > It should thus appear in v6.4.
> 
> I guess that linux-stable.git is a copy&paste failure (and it's not there).
> I don't see the series in the master branch of
> git://linuxtv.org/media_tree.git either.
> 
> .. a bit later ...
> 
> ah, it's in git://linuxtv.org/mchehab/media-next.git
> 
> I guess I was just to quick and probably the series will be included in
> today's next.

I believe patchwork <patchwork@linuxtv.org> will send notification to
author and along with people who applied tags for that patch.

I normally get notification from patchwork <patchwork@linuxtv.org>
When the state of patch changes.

Cheers,
Biju

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 000/117] media: Convert to platform remove callback returning void
  2023-04-17  7:57       ` Biju Das
@ 2023-04-17  8:54         ` Uwe Kleine-König
  0 siblings, 0 replies; 31+ messages in thread
From: Uwe Kleine-König @ 2023-04-17  8:54 UTC (permalink / raw)
  To: Biju Das
  Cc: Laurent Pinchart, Heiko Stuebner, Eddie James, Hans Verkuil,
	Alim Akhtar, Dmitry Osipenko, linux-stm32, Jerome Brunet,
	linux-samsung-soc, Robert Foss, Sean Young, Samuel Holland,
	Kevin Hilman, Michal Simek, Antti Palosaari, NXP Linux Team,
	linux-sunxi, ye xingchen, Sascha Hauer, Łukasz Stelmach,
	Eugen Hristev, Shuah Khan, Andrzej Pietrasiewicz, Hyun Kwon,
	Andrew Jeffery, Michael Tretter, Benoit Parrot, Moudy Ho, kernel,
	Hans Verkuil, Claudiu Beznea, Ming Qian, Andrew-CT Chen,
	Alexandre Belloni, Sylwester Nawrocki, linux-aspeed, Yunfei Dong,
	Lad, Prabhakar, Thierry Reding, Guenter Roeck, chrome-platform,
	Jonathan Hunter, linux-rockchip, Fabien Dessenne,
	Ezequiel Garcia, Alain Volmat, Marek Szyprowski, Colin Ian King,
	linux-media, Jacopo Mondi, Rory Liu, Martin Blumenstingl,
	linux-arm-msm, Sean Wang, Fabrizio Castro, Maxime Ripard,
	linux-amlogic, linux-arm-kernel, Neil Armstrong, Zhou Peng,
	Paul Kocialkowski, Maxime Coquelin, Christophe JAILLET,
	Jacek Anaszewski, Dan Carpenter, Dafna Hirschfeld,
	Xavier Roumegue, Ettore Chimenti, Vikash Garodia,
	Matthias Brugger, Andrzej Hajda, Fabio Estevam,
	Jean-Christophe Trotin, Stanimir Varbanov, Kieran Bingham,
	Jernej Skrabec, Chen-Yu Tsai, Jacob Chen, Joel Stanley,
	Yang Yingliang, Patrice Chotard, Bin Liu, Nathan Chancellor,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Benson Leung,
	Daniel W. S. Almeida, Qiheng Lin, Konrad Dybcio, Kieran Bingham,
	Yang Li, Sakari Ailus, Ricardo Ribalda, Shawn Guo, Minghsiu Tsai,
	Daniel Almeida, Alexandre Torgue, Todor Tomov, Mirela Rabulea,
	Ajye Huang, Scott Chao, linux-renesas-soc, Hugues Fruchet,
	openbmc, Andy Gross, Mikhail Ulyanov, Prabhakar Mahadev Lad,
	Eduardo Valentin, Rui Miguel Silva, linux-mediatek, Yong Deng,
	linux-tegra, Tiffany Lin, AngeloGioacchino Del Regno,
	Bjorn Andersson, Nicolas Ferre, Houlong Wei, Krzysztof Kozlowski,
	Philipp Zabel, Niklas Söderlund

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

On Mon, Apr 17, 2023 at 07:57:57AM +0000, Biju Das wrote:
> Hi Uwe,
> > > I think the series got applied to the master branch of
> > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git.
> > > It should thus appear in v6.4.
> > 
> > I guess that linux-stable.git is a copy&paste failure (and it's not there).
> > I don't see the series in the master branch of
> > git://linuxtv.org/media_tree.git either.
> > 
> > .. a bit later ...
> > 
> > ah, it's in git://linuxtv.org/mchehab/media-next.git
> > 
> > I guess I was just to quick and probably the series will be included in
> > today's next.
> 
> I believe patchwork <patchwork@linuxtv.org> will send notification to
> author and along with people who applied tags for that patch.

Indeed, I got such a notification on Apr 11. But even if I had that on
my radar when asking and considered such notifications reliable in
general, I would have asked, as the patches didn't apprear in next up to
now.

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2023-04-17  9:02 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 14:30 [PATCH 000/117] media: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-26 14:31 ` [PATCH 047/117] media: rcar-fcp: " Uwe Kleine-König
2023-03-27  7:04   ` Geert Uytterhoeven
2023-03-26 14:31 ` [PATCH 048/117] media: rcar-isp: " Uwe Kleine-König
2023-03-27  7:10   ` Geert Uytterhoeven
2023-03-27  8:48   ` Niklas Söderlund
2023-03-26 14:31 ` [PATCH 049/117] media: rcar-core: " Uwe Kleine-König
2023-03-27  7:09   ` Geert Uytterhoeven
2023-03-27  8:47   ` Niklas Söderlund
2023-03-26 14:31 ` [PATCH 050/117] media: rcar-csi2: " Uwe Kleine-König
2023-03-27  7:13   ` Geert Uytterhoeven
2023-03-27  8:49   ` Niklas Söderlund
2023-03-26 14:31 ` [PATCH 051/117] media: rcar_drif: " Uwe Kleine-König
2023-03-27  7:12   ` Geert Uytterhoeven
2023-03-28 13:54   ` Fabrizio Castro
2023-03-26 14:31 ` [PATCH 052/117] media: rcar_fdp1: " Uwe Kleine-König
2023-03-27  7:12   ` Geert Uytterhoeven
2023-03-27  8:39   ` Kieran Bingham
2023-03-26 14:31 ` [PATCH 053/117] media: rcar_jpu: " Uwe Kleine-König
2023-03-27  7:11   ` Geert Uytterhoeven
2023-03-26 14:31 ` [PATCH 054/117] media: renesas-ceu: " Uwe Kleine-König
2023-03-27  7:13   ` Geert Uytterhoeven
2023-03-26 14:31 ` [PATCH 058/117] media: vsp1_drv: " Uwe Kleine-König
2023-03-27  7:11   ` Geert Uytterhoeven
2023-03-27  8:41   ` Kieran Bingham
2023-04-17  6:02 ` [PATCH 000/117] media: " Uwe Kleine-König
2023-04-17  6:19   ` Laurent Pinchart
2023-04-17  7:30     ` Uwe Kleine-König
2023-04-17  7:35       ` Laurent Pinchart
2023-04-17  7:57       ` Biju Das
2023-04-17  8:54         ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).