[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-37-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:26 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH 36/59] rtc: asm9260: stop using deprecated RTC API
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
drivers/rtc/rtc-asm9260.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-asm9260.c b/drivers/rtc/rtc-asm9260.c
index 3ab81cdec00b..c74455bce8b4 100644
--- a/drivers/rtc/rtc-asm9260.c
+++ b/drivers/rtc/rtc-asm9260.c
@@ -284,14 +284,14 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
iowrite32(0, priv->iobase + HW_CIIR);
iowrite32(BM_AMR_OFF, priv->iobase + HW_AMR);
- priv->rtc = devm_rtc_device_register(dev, dev_name(dev),
- &asm9260_rtc_ops, THIS_MODULE);
+ priv->rtc = devm_rtc_allocate_device(dev);
if (IS_ERR(priv->rtc)) {
ret = PTR_ERR(priv->rtc);
- dev_err(dev, "Failed to register RTC device: %d\n", ret);
goto err_return;
}
+ priv->rtc->ops = &asm9260_rtc_ops;
+
ret = devm_request_threaded_irq(dev, irq_alarm, NULL,
asm9260_rtc_irq, IRQF_ONESHOT,
dev_name(dev), priv);
@@ -301,6 +301,10 @@ static int asm9260_rtc_probe(struct platform_device *pdev)
goto err_return;
}
+ ret = devm_rtc_register_device(priv->rtc);
+ if (ret)
+ goto err_return;
+
return 0;
err_return:
--
2.29.1
Powered by blists - more mailing lists