aboutsummaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorGravatar Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 2024-05-06 12:09:16 +0200
committerGravatar Laurent Pinchart <laurent.pinchart@ideasonboard.com> 2024-05-10 00:59:33 +0300
commitabfec2e172c0728363824f45f11a913bd77bd791 (patch)
treeb627188508315c8d78724f08c0256dbd951d37c8 /drivers/media
parentmedia: media: intel/ipu6: Fix spelling mistake "remappinp" -> "remapping" (diff)
downloadlinux-abfec2e172c0728363824f45f11a913bd77bd791.tar.gz
linux-abfec2e172c0728363824f45f11a913bd77bd791.tar.bz2
linux-abfec2e172c0728363824f45f11a913bd77bd791.zip
media: bcm2835-unicam: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/r/20240506100917.1544174-2-u.kleine-koenig@pengutronix.de Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/broadcom/bcm2835-unicam.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
index 3c7878d8d79b..b11bcec5b225 100644
--- a/drivers/media/platform/broadcom/bcm2835-unicam.c
+++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
@@ -2704,7 +2704,7 @@ err_unicam_put:
return ret;
}
-static int unicam_remove(struct platform_device *pdev)
+static void unicam_remove(struct platform_device *pdev)
{
struct unicam_device *unicam = platform_get_drvdata(pdev);
@@ -2718,8 +2718,6 @@ static int unicam_remove(struct platform_device *pdev)
unicam_put(unicam);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
static const struct of_device_id unicam_of_match[] = {
@@ -2730,7 +2728,7 @@ MODULE_DEVICE_TABLE(of, unicam_of_match);
static struct platform_driver unicam_driver = {
.probe = unicam_probe,
- .remove = unicam_remove,
+ .remove_new = unicam_remove,
.driver = {
.name = UNICAM_MODULE_NAME,
.pm = pm_ptr(&unicam_pm_ops),