diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-03-22 10:16:08 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-04-04 11:07:10 +0300 |
commit | b9a1d801a9dd2c20c4ac3a3f0f220ad589a56f88 (patch) | |
tree | a2b324df5e6dea66903341c538c1ddced6009c1d /drivers/rtc | |
parent | b599db3a9f40582d0a3aad6ec16ba1c3712d57c2 (diff) | |
download | linux-b9a1d801a9dd2c20c4ac3a3f0f220ad589a56f88.tar.xz |
rtc: wm831x: set range
The wm831x has a 32bit second counter.
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-wm831x.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c index 7b824dabf104..deaffe0eaf2f 100644 --- a/drivers/rtc/rtc-wm831x.c +++ b/drivers/rtc/rtc-wm831x.c @@ -436,12 +436,16 @@ static int wm831x_rtc_probe(struct platform_device *pdev) device_init_wakeup(&pdev->dev, 1); - wm831x_rtc->rtc = devm_rtc_device_register(&pdev->dev, "wm831x", - &wm831x_rtc_ops, THIS_MODULE); - if (IS_ERR(wm831x_rtc->rtc)) { - ret = PTR_ERR(wm831x_rtc->rtc); - goto err; - } + wm831x_rtc->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(wm831x_rtc->rtc)) + return PTR_ERR(wm831x_rtc->rtc); + + wm831x_rtc->rtc->ops = &wm831x_rtc_ops; + wm831x_rtc->rtc->range_max = U32_MAX; + + ret = rtc_register_device(wm831x_rtc->rtc); + if (ret) + return ret; ret = devm_request_threaded_irq(&pdev->dev, alm_irq, NULL, wm831x_alm_irq, |