Skip to content

Commit 5b10644

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: vt8500: 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-39-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent fff118c commit 5b10644

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rtc/rtc-vt8500.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,12 @@ static int vt8500_rtc_probe(struct platform_device *pdev)
235235
return devm_rtc_register_device(vt8500_rtc->rtc);
236236
}
237237

238-
static int vt8500_rtc_remove(struct platform_device *pdev)
238+
static void vt8500_rtc_remove(struct platform_device *pdev)
239239
{
240240
struct vt8500_rtc *vt8500_rtc = platform_get_drvdata(pdev);
241241

242242
/* Disable alarm matching */
243243
writel(0, vt8500_rtc->regbase + VT8500_RTC_IS);
244-
245-
return 0;
246244
}
247245

248246
static const struct of_device_id wmt_dt_ids[] = {
@@ -253,7 +251,7 @@ MODULE_DEVICE_TABLE(of, wmt_dt_ids);
253251

254252
static struct platform_driver vt8500_rtc_driver = {
255253
.probe = vt8500_rtc_probe,
256-
.remove = vt8500_rtc_remove,
254+
.remove_new = vt8500_rtc_remove,
257255
.driver = {
258256
.name = "vt8500-rtc",
259257
.of_match_table = wmt_dt_ids,

0 commit comments

Comments
 (0)