Skip to content

Commit 289eb35

Browse files
Uwe Kleine-KönigHans Verkuil
authored andcommitted
media: nuvoton: 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 ad9be16 commit 289eb35

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/platform/nuvoton/npcm-video.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,7 +1785,7 @@ static int npcm_video_probe(struct platform_device *pdev)
17851785
return 0;
17861786
}
17871787

1788-
static int npcm_video_remove(struct platform_device *pdev)
1788+
static void npcm_video_remove(struct platform_device *pdev)
17891789
{
17901790
struct device *dev = &pdev->dev;
17911791
struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
@@ -1798,8 +1798,6 @@ static int npcm_video_remove(struct platform_device *pdev)
17981798
if (video->ece.enable)
17991799
npcm_video_ece_stop(video);
18001800
of_reserved_mem_device_release(dev);
1801-
1802-
return 0;
18031801
}
18041802

18051803
static const struct of_device_id npcm_video_match[] = {
@@ -1816,7 +1814,7 @@ static struct platform_driver npcm_video_driver = {
18161814
.of_match_table = npcm_video_match,
18171815
},
18181816
.probe = npcm_video_probe,
1819-
.remove = npcm_video_remove,
1817+
.remove_new = npcm_video_remove,
18201818
};
18211819

18221820
module_platform_driver(npcm_video_driver);

0 commit comments

Comments
 (0)