summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-10-16 22:16:25 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-10-19 22:33:13 +0200
commitd8bced4b72a2a2aee8567e7d13ac2b52dad93c22 (patch)
tree552e5c61a00681754448c0958940d904bec29fb4 /drivers/rtc
parentrtc: vt8500: remove superfluous error message (diff)
downloadlinux-d8bced4b72a2a2aee8567e7d13ac2b52dad93c22.tar.xz
linux-d8bced4b72a2a2aee8567e7d13ac2b52dad93c22.zip
rtc: vt8500: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Link: https://lore.kernel.org/r/20191016201626.31309-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-vt8500.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-vt8500.c b/drivers/rtc/rtc-vt8500.c
index c2ab394912bb..0761478861f8 100644
--- a/drivers/rtc/rtc-vt8500.c
+++ b/drivers/rtc/rtc-vt8500.c
@@ -222,11 +222,12 @@ static int vt8500_rtc_probe(struct platform_device *pdev)
writel(VT8500_RTC_CR_ENABLE,
vt8500_rtc->regbase + VT8500_RTC_CR);
- vt8500_rtc->rtc = devm_rtc_device_register(&pdev->dev, "vt8500-rtc",
- &vt8500_rtc_ops, THIS_MODULE);
+ vt8500_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(vt8500_rtc->rtc))
return PTR_ERR(vt8500_rtc->rtc);
+ vt8500_rtc->rtc->ops = &vt8500_rtc_ops;
+
ret = devm_request_irq(&pdev->dev, vt8500_rtc->irq_alarm,
vt8500_rtc_irq, 0, "rtc alarm", vt8500_rtc);
if (ret < 0) {
@@ -235,7 +236,7 @@ static int vt8500_rtc_probe(struct platform_device *pdev)
return ret;
}
- return 0;
+ return rtc_register_device(vt8500_rtc->rtc);
}
static int vt8500_rtc_remove(struct platform_device *pdev)