Skip to content

Commit 631aa2d

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: wm8350: 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> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20230304133028.2135435-40-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 5b10644 commit 631aa2d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rtc/rtc-wm8350.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,22 +451,20 @@ static int wm8350_rtc_probe(struct platform_device *pdev)
451451
return 0;
452452
}
453453

454-
static int wm8350_rtc_remove(struct platform_device *pdev)
454+
static void wm8350_rtc_remove(struct platform_device *pdev)
455455
{
456456
struct wm8350 *wm8350 = platform_get_drvdata(pdev);
457457

458458
wm8350_free_irq(wm8350, WM8350_IRQ_RTC_SEC, wm8350);
459459
wm8350_free_irq(wm8350, WM8350_IRQ_RTC_ALM, wm8350);
460-
461-
return 0;
462460
}
463461

464462
static SIMPLE_DEV_PM_OPS(wm8350_rtc_pm_ops, wm8350_rtc_suspend,
465463
wm8350_rtc_resume);
466464

467465
static struct platform_driver wm8350_rtc_driver = {
468466
.probe = wm8350_rtc_probe,
469-
.remove = wm8350_rtc_remove,
467+
.remove_new = wm8350_rtc_remove,
470468
.driver = {
471469
.name = "wm8350-rtc",
472470
.pm = &wm8350_rtc_pm_ops,

0 commit comments

Comments
 (0)