linux-samsung-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] rtc: s5m: switch to devm_rtc_allocate_device
@ 2021-08-04 10:41 Alexandre Belloni
  2021-08-04 10:41 ` [PATCH 2/4] rtc: s5m: signal the core when alarm are not available Alexandre Belloni
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Alexandre Belloni @ 2021-08-04 10:41 UTC (permalink / raw)
  To: Alessandro Zummo, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Alexandre Belloni
  Cc: linux-rtc, linux-kernel, linux-samsung-soc

Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows
for further improvement of the driver.

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

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index 6b56f8eacba6..4c1596c55de8 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -788,12 +788,16 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc",
-						 &s5m_rtc_ops, THIS_MODULE);
-
+	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(info->rtc_dev))
 		return PTR_ERR(info->rtc_dev);
 
+	info->rtc_dev->ops = &s5m_rtc_ops;
+
+	err = devm_rtc_register_device(info->rtc_dev);
+	if (err)
+		return err;
+
 	if (!info->irq) {
 		dev_info(&pdev->dev, "Alarm IRQ not available\n");
 		return 0;
-- 
2.31.1


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

end of thread, other threads:[~2021-08-04 12:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 10:41 [PATCH 1/4] rtc: s5m: switch to devm_rtc_allocate_device Alexandre Belloni
2021-08-04 10:41 ` [PATCH 2/4] rtc: s5m: signal the core when alarm are not available Alexandre Belloni
2021-08-04 11:48   ` Krzysztof Kozlowski
2021-08-04 10:41 ` [PATCH 3/4] rtc: s5m: enable wakeup only when available Alexandre Belloni
2021-08-04 11:48   ` Krzysztof Kozlowski
2021-08-04 10:41 ` [PATCH 4/4] rtc: s5m: set range Alexandre Belloni
2021-08-04 12:01   ` Krzysztof Kozlowski
2021-08-04 11:43 ` [PATCH 1/4] rtc: s5m: switch to devm_rtc_allocate_device Krzysztof Kozlowski

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