linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] rtc: jz4740: set range
@ 2019-04-18 10:00 Alexandre Belloni
  2019-04-18 10:00 ` [PATCH 2/7] rtc: jz4740: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Alexandre Belloni @ 2019-04-18 10:00 UTC (permalink / raw)
  To: linux-rtc
  Cc: Paul Cercueil, Mathieu Malaterre, linux-arm-kernel, linux-kernel,
	Alexandre Belloni

RTC_SEC is a 32-bit seconds counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-jz4740.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index d0a891777f44..079469627bd7 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -348,10 +348,18 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					&jz4740_rtc_ops, THIS_MODULE);
+	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtc->rtc)) {
 		ret = PTR_ERR(rtc->rtc);
+		dev_err(&pdev->dev, "Failed to allocate rtc device: %d\n", ret);
+		return ret;
+	}
+
+	rtc->rtc->ops = &jz4740_rtc_ops;
+	rtc->rtc->range_max = U32_MAX;
+
+	ret = rtc_register_device(rtc->rtc);
+	if (ret) {
 		dev_err(&pdev->dev, "Failed to register rtc device: %d\n", ret);
 		return ret;
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-26 14:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18 10:00 [PATCH 1/7] rtc: jz4740: set range Alexandre Belloni
2019-04-18 10:00 ` [PATCH 2/7] rtc: jz4740: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
2019-04-26 14:29   ` Mathieu Malaterre
2019-04-26 14:38     ` Alexandre Belloni
2019-04-18 10:00 ` [PATCH 3/7] rtc: jz4740: remove useless check Alexandre Belloni
2019-04-18 10:00 ` [PATCH 4/7] rtc: jz4740: use .set_time Alexandre Belloni
2019-04-18 10:00 ` [PATCH 5/7] rtc: jz4740: use dev_pm_set_wake_irq() to simplify code Alexandre Belloni
2019-04-18 10:00 ` [PATCH 6/7] rtc: jz4740: rework invalid time detection Alexandre Belloni
2019-04-18 10:00 ` [PATCH 7/7] rtc: jz4740: convert to SPDX identifier Alexandre Belloni
2019-04-26 14:31 ` [PATCH 1/7] rtc: jz4740: set range Mathieu Malaterre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).