linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] rtc: au1xxx: convert to devm_rtc_allocate_device
@ 2020-03-06  0:59 Alexandre Belloni
  2020-03-06  0:59 ` [PATCH 2/4] rtc: au1xxx: remove goto label Alexandre Belloni
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexandre Belloni @ 2020-03-06  0:59 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni; +Cc: linux-rtc, linux-kernel

This allows further improvement of the driver.

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

diff --git a/drivers/rtc/rtc-au1xxx.c b/drivers/rtc/rtc-au1xxx.c
index 7c5530c71285..a13ac73aa2b7 100644
--- a/drivers/rtc/rtc-au1xxx.c
+++ b/drivers/rtc/rtc-au1xxx.c
@@ -99,16 +99,15 @@ static int au1xtoy_rtc_probe(struct platform_device *pdev)
 	while (alchemy_rdsys(AU1000_SYS_CNTRCTRL) & SYS_CNTRL_C0S)
 		msleep(1);
 
-	rtcdev = devm_rtc_device_register(&pdev->dev, "rtc-au1xxx",
-				     &au1xtoy_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtcdev)) {
-		ret = PTR_ERR(rtcdev);
-		goto out_err;
-	}
+	rtcdev = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtcdev))
+		return PTR_ERR(rtcdev);
+
+	rtcdev->ops = &au1xtoy_rtc_ops;
 
 	platform_set_drvdata(pdev, rtcdev);
 
-	return 0;
+	return rtc_register_device(rtcdev);
 
 out_err:
 	return ret;
-- 
2.24.1


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

end of thread, other threads:[~2020-03-06  1:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06  0:59 [PATCH 1/4] rtc: au1xxx: convert to devm_rtc_allocate_device Alexandre Belloni
2020-03-06  0:59 ` [PATCH 2/4] rtc: au1xxx: remove goto label Alexandre Belloni
2020-03-06  0:59 ` [PATCH 3/4] rtc: au1xxx: set range Alexandre Belloni
2020-03-06  0:59 ` [PATCH 4/4] rtc: au1xxx: switch to rtc_time64_to_tm/rtc_tm_to_time64 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).