Skip to content

Commit e853fb1

Browse files
Uwe Kleine-Königkrzk
authored andcommitted
clk: samsung: 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-25-u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent f05dc20 commit e853fb1

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

drivers/clk/samsung/clk-exynos-audss.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int exynos_audss_clk_probe(struct platform_device *pdev)
268268
return ret;
269269
}
270270

271-
static int exynos_audss_clk_remove(struct platform_device *pdev)
271+
static void exynos_audss_clk_remove(struct platform_device *pdev)
272272
{
273273
of_clk_del_provider(pdev->dev.of_node);
274274

@@ -277,8 +277,6 @@ static int exynos_audss_clk_remove(struct platform_device *pdev)
277277

278278
if (!IS_ERR(epll))
279279
clk_disable_unprepare(epll);
280-
281-
return 0;
282280
}
283281

284282
static const struct dev_pm_ops exynos_audss_clk_pm_ops = {
@@ -295,7 +293,7 @@ static struct platform_driver exynos_audss_clk_driver = {
295293
.pm = &exynos_audss_clk_pm_ops,
296294
},
297295
.probe = exynos_audss_clk_probe,
298-
.remove = exynos_audss_clk_remove,
296+
.remove_new = exynos_audss_clk_remove,
299297
};
300298

301299
module_platform_driver(exynos_audss_clk_driver);

drivers/clk/samsung/clk-exynos-clkout.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,13 @@ static int exynos_clkout_probe(struct platform_device *pdev)
196196
return ret;
197197
}
198198

199-
static int exynos_clkout_remove(struct platform_device *pdev)
199+
static void exynos_clkout_remove(struct platform_device *pdev)
200200
{
201201
struct exynos_clkout *clkout = platform_get_drvdata(pdev);
202202

203203
of_clk_del_provider(clkout->np);
204204
clk_hw_unregister(clkout->data.hws[0]);
205205
iounmap(clkout->reg);
206-
207-
return 0;
208206
}
209207

210208
static int __maybe_unused exynos_clkout_suspend(struct device *dev)
@@ -235,7 +233,7 @@ static struct platform_driver exynos_clkout_driver = {
235233
.pm = &exynos_clkout_pm_ops,
236234
},
237235
.probe = exynos_clkout_probe,
238-
.remove = exynos_clkout_remove,
236+
.remove_new = exynos_clkout_remove,
239237
};
240238
module_platform_driver(exynos_clkout_driver);
241239

0 commit comments

Comments
 (0)