Skip to content

Commit 2b9b0a9

Browse files
Uwe Kleine-Königmartinezjavier
authored andcommitted
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: Uwe Kleine-König <[email protected]> Reviewed-by: Paul Cercueil <[email protected]> Signed-off-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3095f11 commit 2b9b0a9

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

drivers/gpu/drm/ingenic/ingenic-drm-drv.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,16 +1449,14 @@ static int ingenic_drm_probe(struct platform_device *pdev)
14491449
return component_master_add_with_match(dev, &ingenic_master_ops, match);
14501450
}
14511451

1452-
static int ingenic_drm_remove(struct platform_device *pdev)
1452+
static void ingenic_drm_remove(struct platform_device *pdev)
14531453
{
14541454
struct device *dev = &pdev->dev;
14551455

14561456
if (!IS_ENABLED(CONFIG_DRM_INGENIC_IPU))
14571457
ingenic_drm_unbind(dev);
14581458
else
14591459
component_master_del(dev, &ingenic_master_ops);
1460-
1461-
return 0;
14621460
}
14631461

14641462
static int ingenic_drm_suspend(struct device *dev)
@@ -1611,7 +1609,7 @@ static struct platform_driver ingenic_drm_driver = {
16111609
.of_match_table = of_match_ptr(ingenic_drm_of_match),
16121610
},
16131611
.probe = ingenic_drm_probe,
1614-
.remove = ingenic_drm_remove,
1612+
.remove_new = ingenic_drm_remove,
16151613
};
16161614

16171615
static int ingenic_drm_init(void)

drivers/gpu/drm/ingenic/ingenic-ipu.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -922,10 +922,9 @@ static int ingenic_ipu_probe(struct platform_device *pdev)
922922
return component_add(&pdev->dev, &ingenic_ipu_ops);
923923
}
924924

925-
static int ingenic_ipu_remove(struct platform_device *pdev)
925+
static void ingenic_ipu_remove(struct platform_device *pdev)
926926
{
927927
component_del(&pdev->dev, &ingenic_ipu_ops);
928-
return 0;
929928
}
930929

931930
static const u32 jz4725b_ipu_formats[] = {
@@ -992,7 +991,7 @@ static struct platform_driver ingenic_ipu_driver = {
992991
.of_match_table = ingenic_ipu_of_match,
993992
},
994993
.probe = ingenic_ipu_probe,
995-
.remove = ingenic_ipu_remove,
994+
.remove_new = ingenic_ipu_remove,
996995
};
997996

998997
struct platform_driver *ingenic_ipu_driver_ptr = &ingenic_ipu_driver;

0 commit comments

Comments
 (0)