linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] rtc: ls1x: switch to rtc_register_device
@ 2018-05-17 20:53 Alexandre Belloni
  2018-05-17 20:53 ` [PATCH 2/3] rtc: ls1x: remove useless label and goto Alexandre Belloni
  2018-05-17 20:53 ` [PATCH 3/3] rtc: ls1x: add range Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-05-17 20:53 UTC (permalink / raw)
  To: linux-rtc; +Cc: Jiaxun Yang, Huacai Chen, linux-kernel, Alexandre Belloni

This allows for future improvement of the driver.

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

diff --git a/drivers/rtc/rtc-ls1x.c b/drivers/rtc/rtc-ls1x.c
index de86f9fabc11..609bd1d013f0 100644
--- a/drivers/rtc/rtc-ls1x.c
+++ b/drivers/rtc/rtc-ls1x.c
@@ -173,15 +173,15 @@ static int ls1x_rtc_probe(struct platform_device *pdev)
 	while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS)
 		usleep_range(1000, 3000);
 
-	rtcdev = devm_rtc_device_register(&pdev->dev, "ls1x-rtc",
-					&ls1x_rtc_ops , THIS_MODULE);
-	if (IS_ERR(rtcdev)) {
-		ret = PTR_ERR(rtcdev);
-		goto err;
-	}
+	rtcdev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtcdev))
+		return PTR_ERR(rtcdev);
 
 	platform_set_drvdata(pdev, rtcdev);
-	return 0;
+	rtcdev->ops = &ls1x_rtc_ops;
+
+	return rtc_register_device(rtcdev);
+
 err:
 	return ret;
 }
-- 
2.17.0

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

end of thread, other threads:[~2018-05-17 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17 20:53 [PATCH 1/3] rtc: ls1x: switch to rtc_register_device Alexandre Belloni
2018-05-17 20:53 ` [PATCH 2/3] rtc: ls1x: remove useless label and goto Alexandre Belloni
2018-05-17 20:53 ` [PATCH 3/3] rtc: ls1x: add range Alexandre Belloni

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).