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

clk: fixed-mmio: 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 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>
Link: https://lore.kernel.org/r/20230312161512.2715500-10-u.kleine-koenig@pengutronix.de
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Uwe Kleine-König and committed by
Stephen Boyd
6f149b65 27237f4b

+2 -4
+2 -4
drivers/clk/clk-fixed-mmio.c
··· 71 71 return 0; 72 72 } 73 73 74 - static int of_fixed_mmio_clk_remove(struct platform_device *pdev) 74 + static void of_fixed_mmio_clk_remove(struct platform_device *pdev) 75 75 { 76 76 struct clk_hw *clk = platform_get_drvdata(pdev); 77 77 78 78 of_clk_del_provider(pdev->dev.of_node); 79 79 clk_hw_unregister_fixed_rate(clk); 80 - 81 - return 0; 82 80 } 83 81 84 82 static const struct of_device_id of_fixed_mmio_clk_ids[] = { ··· 91 93 .of_match_table = of_fixed_mmio_clk_ids, 92 94 }, 93 95 .probe = of_fixed_mmio_clk_probe, 94 - .remove = of_fixed_mmio_clk_remove, 96 + .remove_new = of_fixed_mmio_clk_remove, 95 97 }; 96 98 module_platform_driver(of_fixed_mmio_clk_driver); 97 99