mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
committed by
Hans Verkuil
parent
323dee6e00
commit
98c58c97fd
@@ -1532,12 +1532,12 @@ err_md:
|
||||
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);
|
||||
|
||||
if (!fmd)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
fimc_md_unregister_clk_provider(fmd);
|
||||
v4l2_async_nf_unregister(&fmd->subdev_notifier);
|
||||
@@ -1550,8 +1550,6 @@ static int fimc_md_remove(struct platform_device *pdev)
|
||||
media_device_unregister(&fmd->media_dev);
|
||||
media_device_cleanup(&fmd->media_dev);
|
||||
fimc_md_put_clocks(fmd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct platform_device_id fimc_driver_ids[] __always_unused = {
|
||||
@@ -1568,7 +1566,7 @@ MODULE_DEVICE_TABLE(of, fimc_md_of_match);
|
||||
|
||||
static struct platform_driver fimc_md_driver = {
|
||||
.probe = fimc_md_probe,
|
||||
.remove = fimc_md_remove,
|
||||
.remove_new = fimc_md_remove,
|
||||
.driver = {
|
||||
.of_match_table = of_match_ptr(fimc_md_of_match),
|
||||
.name = "s5p-fimc-md",
|
||||
|
||||
Reference in New Issue
Block a user