]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtc: ep93xx: convert to devm_rtc_allocate_device
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 19 Apr 2019 07:59:59 +0000 (09:59 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 19 Apr 2019 20:37:16 +0000 (22:37 +0200)
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ep93xx.c

index db04ac445c69cad83c9d29ccb32f07df7dc0f137..f15391bc45972700558f545de3ce9fdca395b746 100644 (file)
@@ -138,11 +138,16 @@ static int ep93xx_rtc_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ep93xx_rtc);
 
-       ep93xx_rtc->rtc = devm_rtc_device_register(&pdev->dev,
-                               pdev->name, &ep93xx_rtc_ops, THIS_MODULE);
+       ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
        if (IS_ERR(ep93xx_rtc->rtc))
                return PTR_ERR(ep93xx_rtc->rtc);
 
+       ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops;
+
+       err = rtc_register_device(ep93xx_rtc->rtc);
+       if (err)
+               return err;
+
        err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
        if (err)
                return err;