Skip to content

Commit adebcc1

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

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/rtc/rtc-tps6586x.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,12 @@ static int tps6586x_rtc_probe(struct platform_device *pdev)
279279
return ret;
280280
};
281281

282-
static int tps6586x_rtc_remove(struct platform_device *pdev)
282+
static void tps6586x_rtc_remove(struct platform_device *pdev)
283283
{
284284
struct device *tps_dev = to_tps6586x_dev(&pdev->dev);
285285

286286
tps6586x_update(tps_dev, RTC_CTRL, 0,
287287
RTC_ENABLE | OSC_SRC_SEL | PRE_BYPASS | CL_SEL_MASK);
288-
return 0;
289288
}
290289

291290
#ifdef CONFIG_PM_SLEEP
@@ -317,7 +316,7 @@ static struct platform_driver tps6586x_rtc_driver = {
317316
.pm = &tps6586x_pm_ops,
318317
},
319318
.probe = tps6586x_rtc_probe,
320-
.remove = tps6586x_rtc_remove,
319+
.remove_new = tps6586x_rtc_remove,
321320
};
322321
module_platform_driver(tps6586x_rtc_driver);
323322

0 commit comments

Comments
 (0)