Skip to content

Commit 0824a15

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: rtd119x: 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/20230304133028.2135435-28-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent ade527d commit 0824a15

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rtc/rtc-rtd119x.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,19 @@ static int rtd119x_rtc_probe(struct platform_device *pdev)
216216
return 0;
217217
}
218218

219-
static int rtd119x_rtc_remove(struct platform_device *pdev)
219+
static void rtd119x_rtc_remove(struct platform_device *pdev)
220220
{
221221
struct rtd119x_rtc *data = platform_get_drvdata(pdev);
222222

223223
rtd119x_rtc_set_enabled(&pdev->dev, false);
224224

225225
clk_disable_unprepare(data->clk);
226226
clk_put(data->clk);
227-
228-
return 0;
229227
}
230228

231229
static struct platform_driver rtd119x_rtc_driver = {
232230
.probe = rtd119x_rtc_probe,
233-
.remove = rtd119x_rtc_remove,
231+
.remove_new = rtd119x_rtc_remove,
234232
.driver = {
235233
.name = "rtd1295-rtc",
236234
.of_match_table = rtd119x_rtc_dt_ids,

0 commit comments

Comments
 (0)