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

clk: scpi: 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-16-u.kleine-koenig@pengutronix.de
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Uwe Kleine-König and committed by
Stephen Boyd
dd904848 34014ff8

+2 -3
+2 -3
drivers/clk/clk-scpi.c
··· 246 246 return of_clk_add_hw_provider(np, scpi_of_clk_src_get, clk_data); 247 247 } 248 248 249 - static int scpi_clocks_remove(struct platform_device *pdev) 249 + static void scpi_clocks_remove(struct platform_device *pdev) 250 250 { 251 251 struct device *dev = &pdev->dev; 252 252 struct device_node *child, *np = dev->of_node; ··· 258 258 259 259 for_each_available_child_of_node(np, child) 260 260 of_clk_del_provider(np); 261 - return 0; 262 261 } 263 262 264 263 static int scpi_clocks_probe(struct platform_device *pdev) ··· 304 305 .of_match_table = scpi_clocks_ids, 305 306 }, 306 307 .probe = scpi_clocks_probe, 307 - .remove = scpi_clocks_remove, 308 + .remove_new = scpi_clocks_remove, 308 309 }; 309 310 module_platform_driver(scpi_clocks_driver); 310 311