]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
rtc: ps3: convert to devm_rtc_allocate_device
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 20 Mar 2019 12:44:27 +0000 (13:44 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 4 Apr 2019 08:07:09 +0000 (10:07 +0200)
This allows further improvement of the driver.

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

index 6c8ec805d2b2ee05106d2133a1dd078440deb0ff..446f5e23301aa45410f46c51561312f465dba713 100644 (file)
@@ -47,13 +47,15 @@ static int __init ps3_rtc_probe(struct platform_device *dev)
 {
        struct rtc_device *rtc;
 
-       rtc = devm_rtc_device_register(&dev->dev, "rtc-ps3", &ps3_rtc_ops,
-                                 THIS_MODULE);
+       rtc = devm_rtc_allocate_device(&dev->dev);
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
 
+       rtc->ops = &ps3_rtc_ops;
+
        platform_set_drvdata(dev, rtc);
-       return 0;
+
+       return rtc_register_device(rtc);
 }
 
 static struct platform_driver ps3_rtc_driver = {