Commit 42f8f4cd authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Hans Verkuil

media: coda-common: 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 60fa2efb
...@@ -3300,7 +3300,7 @@ static int coda_probe(struct platform_device *pdev) ...@@ -3300,7 +3300,7 @@ static int coda_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int coda_remove(struct platform_device *pdev) static void coda_remove(struct platform_device *pdev)
{ {
struct coda_dev *dev = platform_get_drvdata(pdev); struct coda_dev *dev = platform_get_drvdata(pdev);
int i; int i;
...@@ -3322,7 +3322,6 @@ static int coda_remove(struct platform_device *pdev) ...@@ -3322,7 +3322,6 @@ static int coda_remove(struct platform_device *pdev)
coda_free_aux_buf(dev, &dev->workbuf); coda_free_aux_buf(dev, &dev->workbuf);
debugfs_remove_recursive(dev->debugfs_root); debugfs_remove_recursive(dev->debugfs_root);
ida_destroy(&dev->ida); ida_destroy(&dev->ida);
return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -3347,7 +3346,7 @@ static const struct dev_pm_ops coda_pm_ops = { ...@@ -3347,7 +3346,7 @@ static const struct dev_pm_ops coda_pm_ops = {
static struct platform_driver coda_driver = { static struct platform_driver coda_driver = {
.probe = coda_probe, .probe = coda_probe,
.remove = coda_remove, .remove_new = coda_remove,
.driver = { .driver = {
.name = CODA_NAME, .name = CODA_NAME,
.of_match_table = coda_dt_ids, .of_match_table = coda_dt_ids,
......
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