Skip to content

Commit cf407e9

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: sa1100: 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-31-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 9e6a2ad commit cf407e9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rtc/rtc-sa1100.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ static int sa1100_rtc_probe(struct platform_device *pdev)
297297
return sa1100_rtc_init(pdev, info);
298298
}
299299

300-
static int sa1100_rtc_remove(struct platform_device *pdev)
300+
static void sa1100_rtc_remove(struct platform_device *pdev)
301301
{
302302
struct sa1100_rtc *info = platform_get_drvdata(pdev);
303303

@@ -307,8 +307,6 @@ static int sa1100_rtc_remove(struct platform_device *pdev)
307307
spin_unlock_irq(&info->lock);
308308
clk_disable_unprepare(info->clk);
309309
}
310-
311-
return 0;
312310
}
313311

314312
#ifdef CONFIG_PM_SLEEP
@@ -343,7 +341,7 @@ MODULE_DEVICE_TABLE(of, sa1100_rtc_dt_ids);
343341

344342
static struct platform_driver sa1100_rtc_driver = {
345343
.probe = sa1100_rtc_probe,
346-
.remove = sa1100_rtc_remove,
344+
.remove_new = sa1100_rtc_remove,
347345
.driver = {
348346
.name = "sa1100-rtc",
349347
.pm = &sa1100_rtc_pm_ops,

0 commit comments

Comments
 (0)