Commit 98c58c97 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Hans Verkuil

media: media-dev: 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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 323dee6e
...@@ -1532,12 +1532,12 @@ static int fimc_md_probe(struct platform_device *pdev) ...@@ -1532,12 +1532,12 @@ static int fimc_md_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int fimc_md_remove(struct platform_device *pdev) static void fimc_md_remove(struct platform_device *pdev)
{ {
struct fimc_md *fmd = platform_get_drvdata(pdev); struct fimc_md *fmd = platform_get_drvdata(pdev);
if (!fmd) if (!fmd)
return 0; return;
fimc_md_unregister_clk_provider(fmd); fimc_md_unregister_clk_provider(fmd);
v4l2_async_nf_unregister(&fmd->subdev_notifier); v4l2_async_nf_unregister(&fmd->subdev_notifier);
...@@ -1550,8 +1550,6 @@ static int fimc_md_remove(struct platform_device *pdev) ...@@ -1550,8 +1550,6 @@ static int fimc_md_remove(struct platform_device *pdev)
media_device_unregister(&fmd->media_dev); media_device_unregister(&fmd->media_dev);
media_device_cleanup(&fmd->media_dev); media_device_cleanup(&fmd->media_dev);
fimc_md_put_clocks(fmd); fimc_md_put_clocks(fmd);
return 0;
} }
static const struct platform_device_id fimc_driver_ids[] __always_unused = { static const struct platform_device_id fimc_driver_ids[] __always_unused = {
...@@ -1568,7 +1566,7 @@ MODULE_DEVICE_TABLE(of, fimc_md_of_match); ...@@ -1568,7 +1566,7 @@ MODULE_DEVICE_TABLE(of, fimc_md_of_match);
static struct platform_driver fimc_md_driver = { static struct platform_driver fimc_md_driver = {
.probe = fimc_md_probe, .probe = fimc_md_probe,
.remove = fimc_md_remove, .remove_new = fimc_md_remove,
.driver = { .driver = {
.of_match_table = of_match_ptr(fimc_md_of_match), .of_match_table = of_match_ptr(fimc_md_of_match),
.name = "s5p-fimc-md", .name = "s5p-fimc-md",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment