summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ac100.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-02 23:19:19 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-02 23:19:19 +0100
commitbf644990a796bd72d6f3977f3307169919a23f85 (patch)
tree812913216ec1ff6c8223169a743cbf0a0504291a /drivers/rtc/rtc-ac100.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mat... (diff)
parentrtc: remove rtc-at32ap700x (diff)
downloadlinux-bf644990a796bd72d6f3977f3307169919a23f85.tar.xz
linux-bf644990a796bd72d6f3977f3307169919a23f85.zip
Merge tag 'rtc-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "Not much this cycle. I've pushed the at32ap700x removal late but it is unlikely to cause any issues. Summary: Subsystem: - Move ABI documentation to Documentation/ABI New driver: - NXP i.MX53 SRTC - Chrome OS EC RTC Drivers: - Remove at32ap700x - Many fixes in various error paths" * tag 'rtc-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: remove rtc-at32ap700x Documentation: rtc: move iotcl interface documentation to ABI Documentation: rtc: add sysfs file permissions Documentation: rtc: move sysfs documentation to ABI rtc: mxc_v2: remove __exit annotation rtc: mxc_v2: Remove unnecessary platform_get_resource() error check rtc: add mxc driver for i.MX53 SRTC dt-bindings: rtc: add bindings for i.MX53 SRTC rtc: r7301: Fix a possible sleep-in-atomic bug in rtc7301_set_time rtc: r7301: Fix a possible sleep-in-atomic bug in rtc7301_read_time rtc: omap: fix unbalanced clk_prepare_enable/clk_disable_unprepare rtc: ac100: Fix multiple race conditions rtc: sun6i: ensure rtc is kfree'd on error rtc: cros-ec: add cros-ec-rtc driver. mfd: cros_ec: Introduce RTC commands and events definitions. rtc: stm32: Fix copyright rtc: Remove unused RTC_DEVICE_NAME_SIZE rtc: r9701: Remove r9701_remove function rtc: brcmstb-waketimer: fix error handling in brcmstb_waketmr_probe()
Diffstat (limited to 'drivers/rtc/rtc-ac100.c')
-rw-r--r--drivers/rtc/rtc-ac100.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c
index 0282ccc6181c..8ff9dc3fe5bf 100644
--- a/drivers/rtc/rtc-ac100.c
+++ b/drivers/rtc/rtc-ac100.c
@@ -569,6 +569,12 @@ static int ac100_rtc_probe(struct platform_device *pdev)
return chip->irq;
}
+ chip->rtc = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(chip->rtc))
+ return PTR_ERR(chip->rtc);
+
+ chip->rtc->ops = &ac100_rtc_ops;
+
ret = devm_request_threaded_irq(&pdev->dev, chip->irq, NULL,
ac100_rtc_irq,
IRQF_SHARED | IRQF_ONESHOT,
@@ -588,17 +594,16 @@ static int ac100_rtc_probe(struct platform_device *pdev)
/* clear counter alarm pending interrupts */
regmap_write(chip->regmap, AC100_ALM_INT_STA, AC100_ALM_INT_ENABLE);
- chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-ac100",
- &ac100_rtc_ops, THIS_MODULE);
- if (IS_ERR(chip->rtc)) {
- dev_err(&pdev->dev, "unable to register device\n");
- return PTR_ERR(chip->rtc);
- }
-
ret = ac100_rtc_register_clks(chip);
if (ret)
return ret;
+ ret = rtc_register_device(chip->rtc);
+ if (ret) {
+ dev_err(&pdev->dev, "unable to register device\n");
+ return ret;
+ }
+
dev_info(&pdev->dev, "RTC enabled\n");
return 0;