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

PM / devfreq: exynos-ppmu: 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
177e15df 45d8b572

+2 -4
+2 -4
drivers/devfreq/event/exynos-ppmu.c
··· 692 692 return 0; 693 693 } 694 694 695 - static int exynos_ppmu_remove(struct platform_device *pdev) 695 + static void exynos_ppmu_remove(struct platform_device *pdev) 696 696 { 697 697 struct exynos_ppmu *info = platform_get_drvdata(pdev); 698 698 699 699 clk_disable_unprepare(info->ppmu.clk); 700 - 701 - return 0; 702 700 } 703 701 704 702 static struct platform_driver exynos_ppmu_driver = { 705 703 .probe = exynos_ppmu_probe, 706 - .remove = exynos_ppmu_remove, 704 + .remove_new = exynos_ppmu_remove, 707 705 .driver = { 708 706 .name = "exynos-ppmu", 709 707 .of_match_table = exynos_ppmu_id_match,