Skip to content

Commit 72cd843

Browse files
Uwe Kleine-Königgeertu
authored andcommitted
clk: renesas: 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> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230312161512.2715500-24-u.kleine-koenig@pengutronix.de Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 1ef4813 commit 72cd843

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/renesas/rcar-usb2-clock-sel.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,13 @@ static int rcar_usb2_clock_sel_resume(struct device *dev)
125125
return 0;
126126
}
127127

128-
static int rcar_usb2_clock_sel_remove(struct platform_device *pdev)
128+
static void rcar_usb2_clock_sel_remove(struct platform_device *pdev)
129129
{
130130
struct device *dev = &pdev->dev;
131131

132132
of_clk_del_provider(dev->of_node);
133133
pm_runtime_put(dev);
134134
pm_runtime_disable(dev);
135-
136-
return 0;
137135
}
138136

139137
static int rcar_usb2_clock_sel_probe(struct platform_device *pdev)
@@ -215,7 +213,7 @@ static struct platform_driver rcar_usb2_clock_sel_driver = {
215213
.pm = &rcar_usb2_clock_sel_pm_ops,
216214
},
217215
.probe = rcar_usb2_clock_sel_probe,
218-
.remove = rcar_usb2_clock_sel_remove,
216+
.remove_new = rcar_usb2_clock_sel_remove,
219217
};
220218
builtin_platform_driver(rcar_usb2_clock_sel_driver);
221219

0 commit comments

Comments
 (0)