diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-04-03 16:40:01 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-04-15 07:55:59 +0100 |
commit | 162a87b562e1106f0660c074072b60977d03d478 (patch) | |
tree | ffaacf70f6bfd3ee444e9d4b43c286ba8ef21d2b /drivers/staging/media/imx | |
parent | d24bbc5452a8a8adc40b68a2bb91497fc6696509 (diff) | |
download | linux-stable-162a87b562e1106f0660c074072b60977d03d478.tar.gz linux-stable-162a87b562e1106f0660c074072b60977d03d478.tar.bz2 linux-stable-162a87b562e1106f0660c074072b60977d03d478.zip |
media: staging: media: imx8mq-mipi-csi2: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media/imx')
-rw-r--r-- | drivers/staging/media/imx/imx8mq-mipi-csi2.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/media/imx/imx8mq-mipi-csi2.c b/drivers/staging/media/imx/imx8mq-mipi-csi2.c index 2cfb28eb66b1..32700cb8bc4d 100644 --- a/drivers/staging/media/imx/imx8mq-mipi-csi2.c +++ b/drivers/staging/media/imx/imx8mq-mipi-csi2.c @@ -924,7 +924,7 @@ mutex: return ret; } -static int imx8mq_mipi_csi_remove(struct platform_device *pdev) +static void imx8mq_mipi_csi_remove(struct platform_device *pdev) { struct v4l2_subdev *sd = platform_get_drvdata(pdev); struct csi_state *state = mipi_sd_to_csi2_state(sd); @@ -940,8 +940,6 @@ static int imx8mq_mipi_csi_remove(struct platform_device *pdev) mutex_destroy(&state->lock); pm_runtime_set_suspended(&pdev->dev); imx8mq_mipi_csi_release_icc(pdev); - - return 0; } static const struct of_device_id imx8mq_mipi_csi_of_match[] = { @@ -952,7 +950,7 @@ MODULE_DEVICE_TABLE(of, imx8mq_mipi_csi_of_match); static struct platform_driver imx8mq_mipi_csi_driver = { .probe = imx8mq_mipi_csi_probe, - .remove = imx8mq_mipi_csi_remove, + .remove_new = imx8mq_mipi_csi_remove, .driver = { .of_match_table = imx8mq_mipi_csi_of_match, .name = MIPI_CSI2_DRIVER_NAME, |