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

clk: s2mps11: 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-15-u.kleine-koenig@pengutronix.de
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

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

+2 -4
+2 -4
drivers/clk/clk-s2mps11.c
··· 202 202 return ret; 203 203 } 204 204 205 - static int s2mps11_clk_remove(struct platform_device *pdev) 205 + static void s2mps11_clk_remove(struct platform_device *pdev) 206 206 { 207 207 struct s2mps11_clk *s2mps11_clks = platform_get_drvdata(pdev); 208 208 int i; ··· 217 217 continue; 218 218 clkdev_drop(s2mps11_clks[i].lookup); 219 219 } 220 - 221 - return 0; 222 220 } 223 221 224 222 static const struct platform_device_id s2mps11_clk_id[] = { ··· 263 265 .name = "s2mps11-clk", 264 266 }, 265 267 .probe = s2mps11_clk_probe, 266 - .remove = s2mps11_clk_remove, 268 + .remove_new = s2mps11_clk_remove, 267 269 .id_table = s2mps11_clk_id, 268 270 }; 269 271 module_platform_driver(s2mps11_clk_driver);