Commit 2b9b0a9f authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Javier Martinez Canillas

drm/ingenic: 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 the ingenic drm drivers 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>
Reviewed-by: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-24-u.kleine-koenig@pengutronix.de
parent 3095f112
...@@ -1449,7 +1449,7 @@ static int ingenic_drm_probe(struct platform_device *pdev) ...@@ -1449,7 +1449,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
return component_master_add_with_match(dev, &ingenic_master_ops, match); return component_master_add_with_match(dev, &ingenic_master_ops, match);
} }
static int ingenic_drm_remove(struct platform_device *pdev) static void ingenic_drm_remove(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -1457,8 +1457,6 @@ static int ingenic_drm_remove(struct platform_device *pdev) ...@@ -1457,8 +1457,6 @@ static int ingenic_drm_remove(struct platform_device *pdev)
ingenic_drm_unbind(dev); ingenic_drm_unbind(dev);
else else
component_master_del(dev, &ingenic_master_ops); component_master_del(dev, &ingenic_master_ops);
return 0;
} }
static int ingenic_drm_suspend(struct device *dev) static int ingenic_drm_suspend(struct device *dev)
...@@ -1611,7 +1609,7 @@ static struct platform_driver ingenic_drm_driver = { ...@@ -1611,7 +1609,7 @@ static struct platform_driver ingenic_drm_driver = {
.of_match_table = of_match_ptr(ingenic_drm_of_match), .of_match_table = of_match_ptr(ingenic_drm_of_match),
}, },
.probe = ingenic_drm_probe, .probe = ingenic_drm_probe,
.remove = ingenic_drm_remove, .remove_new = ingenic_drm_remove,
}; };
static int ingenic_drm_init(void) static int ingenic_drm_init(void)
......
...@@ -922,10 +922,9 @@ static int ingenic_ipu_probe(struct platform_device *pdev) ...@@ -922,10 +922,9 @@ static int ingenic_ipu_probe(struct platform_device *pdev)
return component_add(&pdev->dev, &ingenic_ipu_ops); return component_add(&pdev->dev, &ingenic_ipu_ops);
} }
static int ingenic_ipu_remove(struct platform_device *pdev) static void ingenic_ipu_remove(struct platform_device *pdev)
{ {
component_del(&pdev->dev, &ingenic_ipu_ops); component_del(&pdev->dev, &ingenic_ipu_ops);
return 0;
} }
static const u32 jz4725b_ipu_formats[] = { static const u32 jz4725b_ipu_formats[] = {
...@@ -992,7 +991,7 @@ static struct platform_driver ingenic_ipu_driver = { ...@@ -992,7 +991,7 @@ static struct platform_driver ingenic_ipu_driver = {
.of_match_table = ingenic_ipu_of_match, .of_match_table = ingenic_ipu_of_match,
}, },
.probe = ingenic_ipu_probe, .probe = ingenic_ipu_probe,
.remove = ingenic_ipu_remove, .remove_new = ingenic_ipu_remove,
}; };
struct platform_driver *ingenic_ipu_driver_ptr = &ingenic_ipu_driver; struct platform_driver *ingenic_ipu_driver_ptr = &ingenic_ipu_driver;
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