summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-goldfish.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-20 13:34:12 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-04 10:07:08 +0200
commit409b84e3eb941bf3a9486f9f90626a6d31d33b41 (patch)
tree938213b9d6f8a02c9ba315c4f41ca09a04a58857 /drivers/rtc/rtc-goldfish.c
parentrtc: xgene: use .set_time (diff)
downloadlinux-409b84e3eb941bf3a9486f9f90626a6d31d33b41.tar.xz
linux-409b84e3eb941bf3a9486f9f90626a6d31d33b41.zip
rtc: goldfish: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-goldfish.c')
-rw-r--r--drivers/rtc/rtc-goldfish.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-goldfish.c b/drivers/rtc/rtc-goldfish.c
index a1c44d0c8557..d4cb33f209fb 100644
--- a/drivers/rtc/rtc-goldfish.c
+++ b/drivers/rtc/rtc-goldfish.c
@@ -205,19 +205,19 @@ static int goldfish_rtc_probe(struct platform_device *pdev)
if (rtcdrv->irq < 0)
return -ENODEV;
- rtcdrv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &goldfish_rtc_ops,
- THIS_MODULE);
+ rtcdrv->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtcdrv->rtc))
return PTR_ERR(rtcdrv->rtc);
+ rtcdrv->rtc->ops = &goldfish_rtc_ops;
+
err = devm_request_irq(&pdev->dev, rtcdrv->irq,
goldfish_rtc_interrupt,
0, pdev->name, rtcdrv);
if (err)
return err;
- return 0;
+ return rtc_register_device(rtcdrv->rtc);
}
static const struct of_device_id goldfish_rtc_of_match[] = {