Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <u.kleine-koenig@pengutronix.de>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Uwe Kleine-König and committed by
Chanwoo Choi
14532a01 0df02586

+2 -4
+2 -4
drivers/devfreq/sun8i-a33-mbus.c
··· 458 458 return dev_err_probe(dev, ret, err); 459 459 } 460 460 461 - static int sun8i_a33_mbus_remove(struct platform_device *pdev) 461 + static void sun8i_a33_mbus_remove(struct platform_device *pdev) 462 462 { 463 463 struct sun8i_a33_mbus *priv = platform_get_drvdata(pdev); 464 464 unsigned long initial_freq = priv->profile.initial_freq; ··· 475 475 clk_rate_exclusive_put(priv->clk_mbus); 476 476 clk_rate_exclusive_put(priv->clk_dram); 477 477 clk_disable_unprepare(priv->clk_bus); 478 - 479 - return 0; 480 478 } 481 479 482 480 static const struct sun8i_a33_mbus_variant sun50i_a64_mbus = { ··· 495 497 496 498 static struct platform_driver sun8i_a33_mbus_driver = { 497 499 .probe = sun8i_a33_mbus_probe, 498 - .remove = sun8i_a33_mbus_remove, 500 + .remove_new = sun8i_a33_mbus_remove, 499 501 .driver = { 500 502 .name = "sun8i-a33-mbus", 501 503 .of_match_table = sun8i_a33_mbus_of_match,