Skip to content

Commit 1f715c0

Browse files
Uwe Kleine-KönigHans Verkuil
authored andcommitted
media: stm32-dcmipp: 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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent e992ee7 commit 1f715c0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ static int dcmipp_probe(struct platform_device *pdev)
517517
return 0;
518518
}
519519

520-
static int dcmipp_remove(struct platform_device *pdev)
520+
static void dcmipp_remove(struct platform_device *pdev)
521521
{
522522
struct dcmipp_device *dcmipp = platform_get_drvdata(pdev);
523523
unsigned int i;
@@ -534,8 +534,6 @@ static int dcmipp_remove(struct platform_device *pdev)
534534
media_device_cleanup(&dcmipp->mdev);
535535

536536
v4l2_device_unregister(&dcmipp->v4l2_dev);
537-
538-
return 0;
539537
}
540538

541539
static int dcmipp_runtime_suspend(struct device *dev)
@@ -588,7 +586,7 @@ static const struct dev_pm_ops dcmipp_pm_ops = {
588586

589587
static struct platform_driver dcmipp_pdrv = {
590588
.probe = dcmipp_probe,
591-
.remove = dcmipp_remove,
589+
.remove_new = dcmipp_remove,
592590
.driver = {
593591
.name = DCMIPP_PDEV_NAME,
594592
.of_match_table = dcmipp_of_match,

0 commit comments

Comments
 (0)