summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-26 16:32:00 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 16:59:19 +0200
commite65db25b8d7a3d06b96f735df13a3f7d88c8b688 (patch)
tree1c0e897f30fdf5bce85ae4fc9d38697862b7bc2f
parentmedia: hantro_drv: Convert to platform remove callback returning void (diff)
downloadlinux-e65db25b8d7a3d06b96f735df13a3f7d88c8b688.tar.xz
linux-e65db25b8d7a3d06b96f735df13a3f7d88c8b688.zip
media: via-camera: 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> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/platform/via/via-camera.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/platform/via/via-camera.c b/drivers/media/platform/via/via-camera.c
index 885917cff738..f5181314b1d0 100644
--- a/drivers/media/platform/via/via-camera.c
+++ b/drivers/media/platform/via/via-camera.c
@@ -1296,7 +1296,7 @@ out_free:
return ret;
}
-static int viacam_remove(struct platform_device *pdev)
+static void viacam_remove(struct platform_device *pdev)
{
struct via_camera *cam = via_cam_info;
struct viafb_dev *viadev = pdev->dev.platform_data;
@@ -1311,7 +1311,6 @@ static int viacam_remove(struct platform_device *pdev)
v4l2_ctrl_handler_free(&cam->ctrl_handler);
kfree(cam);
via_cam_info = NULL;
- return 0;
}
static struct platform_driver viacam_driver = {
@@ -1319,7 +1318,7 @@ static struct platform_driver viacam_driver = {
.name = "viafb-camera",
},
.probe = viacam_probe,
- .remove = viacam_remove,
+ .remove_new = viacam_remove,
};
module_platform_driver(viacam_driver);