Skip to content

Commit 0d65f74

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
clk: stm32: 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-26-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent d9f139d commit 0d65f74

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/stm32/clk-stm32mp13.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,15 +1593,13 @@ static int stm32mp1_rcc_clocks_probe(struct platform_device *pdev)
15931593
return ret;
15941594
}
15951595

1596-
static int stm32mp1_rcc_clocks_remove(struct platform_device *pdev)
1596+
static void stm32mp1_rcc_clocks_remove(struct platform_device *pdev)
15971597
{
15981598
struct device *dev = &pdev->dev;
15991599
struct device_node *child, *np = dev_of_node(dev);
16001600

16011601
for_each_available_child_of_node(np, child)
16021602
of_clk_del_provider(child);
1603-
1604-
return 0;
16051603
}
16061604

16071605
static struct platform_driver stm32mp13_rcc_clocks_driver = {
@@ -1610,7 +1608,7 @@ static struct platform_driver stm32mp13_rcc_clocks_driver = {
16101608
.of_match_table = stm32mp13_match_data,
16111609
},
16121610
.probe = stm32mp1_rcc_clocks_probe,
1613-
.remove = stm32mp1_rcc_clocks_remove,
1611+
.remove_new = stm32mp1_rcc_clocks_remove,
16141612
};
16151613

16161614
static int __init stm32mp13_clocks_init(void)

0 commit comments

Comments
 (0)