Skip to content

Commit e55fbc8

Browse files
Uwe Kleine-Königalexandrebelloni
authored andcommitted
rtc: rzn1: 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> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/r/20230304133028.2135435-29-u.kleine-koenig@pengutronix.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 0824a15 commit e55fbc8

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/rtc/rtc-rzn1.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,9 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
391391
return ret;
392392
}
393393

394-
static int rzn1_rtc_remove(struct platform_device *pdev)
394+
static void rzn1_rtc_remove(struct platform_device *pdev)
395395
{
396396
pm_runtime_put(&pdev->dev);
397-
398-
return 0;
399397
}
400398

401399
static const struct of_device_id rzn1_rtc_of_match[] = {
@@ -406,7 +404,7 @@ MODULE_DEVICE_TABLE(of, rzn1_rtc_of_match);
406404

407405
static struct platform_driver rzn1_rtc_driver = {
408406
.probe = rzn1_rtc_probe,
409-
.remove = rzn1_rtc_remove,
407+
.remove_new = rzn1_rtc_remove,
410408
.driver = {
411409
.name = "rzn1-rtc",
412410
.of_match_table = rzn1_rtc_of_match,

0 commit comments

Comments
 (0)