Skip to content

Commit 14532a0

Browse files
Uwe Kleine-Königchanwoochoi
authored andcommitted
PM / devfreq: sun8i-a33-mbus: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 0df0258 commit 14532a0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/devfreq/sun8i-a33-mbus.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ static int sun8i_a33_mbus_probe(struct platform_device *pdev)
458458
return dev_err_probe(dev, ret, err);
459459
}
460460

461-
static int sun8i_a33_mbus_remove(struct platform_device *pdev)
461+
static void sun8i_a33_mbus_remove(struct platform_device *pdev)
462462
{
463463
struct sun8i_a33_mbus *priv = platform_get_drvdata(pdev);
464464
unsigned long initial_freq = priv->profile.initial_freq;
@@ -475,8 +475,6 @@ static int sun8i_a33_mbus_remove(struct platform_device *pdev)
475475
clk_rate_exclusive_put(priv->clk_mbus);
476476
clk_rate_exclusive_put(priv->clk_dram);
477477
clk_disable_unprepare(priv->clk_bus);
478-
479-
return 0;
480478
}
481479

482480
static const struct sun8i_a33_mbus_variant sun50i_a64_mbus = {
@@ -497,7 +495,7 @@ static SIMPLE_DEV_PM_OPS(sun8i_a33_mbus_pm_ops,
497495

498496
static struct platform_driver sun8i_a33_mbus_driver = {
499497
.probe = sun8i_a33_mbus_probe,
500-
.remove = sun8i_a33_mbus_remove,
498+
.remove_new = sun8i_a33_mbus_remove,
501499
.driver = {
502500
.name = "sun8i-a33-mbus",
503501
.of_match_table = sun8i_a33_mbus_of_match,

0 commit comments

Comments
 (0)