linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] rtc: goldfish: convert to devm_rtc_allocate_device
@ 2019-03-20 12:34 Alexandre Belloni
  2019-03-20 12:34 ` [PATCH 2/6] rtc: goldfish: add range Alexandre Belloni
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Alexandre Belloni @ 2019-03-20 12:34 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-goldfish.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-goldfish.c b/drivers/rtc/rtc-goldfish.c
index a1c44d0c8557..d4cb33f209fb 100644
--- a/drivers/rtc/rtc-goldfish.c
+++ b/drivers/rtc/rtc-goldfish.c
@@ -205,19 +205,19 @@ static int goldfish_rtc_probe(struct platform_device *pdev)
 	if (rtcdrv->irq < 0)
 		return -ENODEV;
 
-	rtcdrv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					       &goldfish_rtc_ops,
-					       THIS_MODULE);
+	rtcdrv->rtc = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(rtcdrv->rtc))
 		return PTR_ERR(rtcdrv->rtc);
 
+	rtcdrv->rtc->ops = &goldfish_rtc_ops;
+
 	err = devm_request_irq(&pdev->dev, rtcdrv->irq,
 			       goldfish_rtc_interrupt,
 			       0, pdev->name, rtcdrv);
 	if (err)
 		return err;
 
-	return 0;
+	return rtc_register_device(rtcdrv->rtc);
 }
 
 static const struct of_device_id goldfish_rtc_of_match[] = {
-- 
2.20.1


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

end of thread, other threads:[~2019-03-20 12:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 12:34 [PATCH 1/6] rtc: goldfish: convert to devm_rtc_allocate_device Alexandre Belloni
2019-03-20 12:34 ` [PATCH 2/6] rtc: goldfish: add range Alexandre Belloni
2019-03-20 12:34 ` [PATCH 3/6] rtc: goldfish: sort headers Alexandre Belloni
2019-03-20 12:34 ` [PATCH 4/6] rtc: goldfish: allow building on more than MIPS Alexandre Belloni
2019-03-20 12:34 ` [PATCH 5/6] rtc: goldfish: switch to rtc_time64_to_tm/rtc_tm_to_time64 Alexandre Belloni
2019-03-20 12:34 ` [PATCH 6/6] rtc: goldfish: convert to SPDX identifier 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).