linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] rtc: test: convert to devm_rtc_allocate_device
@ 2018-06-05 21:09 Alexandre Belloni
  2018-06-05 21:09 ` [PATCH 2/3] rtc: test: remove alarm support from the first device Alexandre Belloni
  2018-06-05 21:09 ` [PATCH 3/3] rtc: ensure rtc_set_alarm fails when alarms are not supported Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-06-05 21:09 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

This allows further improvement of the driver.

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

diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 70d4ab1d2769..6a6bc1f2a14d 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -120,15 +120,16 @@ static int test_probe(struct platform_device *plat_dev)
 
 	platform_set_drvdata(plat_dev, rtd);
 
-	rtd->rtc = devm_rtc_device_register(&plat_dev->dev, "test",
-					    &test_rtc_ops, THIS_MODULE);
+	rtd->rtc = devm_rtc_allocate_device(&plat_dev->dev);
 	if (IS_ERR(rtd->rtc))
 		return PTR_ERR(rtd->rtc);
 
+	rtd->rtc->ops = &test_rtc_ops;
+
 	timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0);
 	rtd->alarm.expires = 0;
 
-	return 0;
+	return rtc_register_device(rtd->rtc);
 }
 
 static struct platform_driver test_driver = {
-- 
2.17.1

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-05 21:09 [PATCH 1/3] rtc: test: convert to devm_rtc_allocate_device Alexandre Belloni
2018-06-05 21:09 ` [PATCH 2/3] rtc: test: remove alarm support from the first device Alexandre Belloni
2018-06-05 21:09 ` [PATCH 3/3] rtc: ensure rtc_set_alarm fails when alarms are not supported 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).