Skip to content

Commit 25ffc85

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

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rtc/rtc-spear.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,13 @@ static int spear_rtc_probe(struct platform_device *pdev)
405405
return status;
406406
}
407407

408-
static int spear_rtc_remove(struct platform_device *pdev)
408+
static void spear_rtc_remove(struct platform_device *pdev)
409409
{
410410
struct spear_rtc_config *config = platform_get_drvdata(pdev);
411411

412412
spear_rtc_disable_interrupt(config);
413413
clk_disable_unprepare(config->clk);
414414
device_init_wakeup(&pdev->dev, 0);
415-
416-
return 0;
417415
}
418416

419417
#ifdef CONFIG_PM_SLEEP
@@ -477,7 +475,7 @@ MODULE_DEVICE_TABLE(of, spear_rtc_id_table);
477475

478476
static struct platform_driver spear_rtc_driver = {
479477
.probe = spear_rtc_probe,
480-
.remove = spear_rtc_remove,
478+
.remove_new = spear_rtc_remove,
481479
.shutdown = spear_rtc_shutdown,
482480
.driver = {
483481
.name = "rtc-spear",

0 commit comments

Comments
 (0)