[PATCH 22/59] rtc: moxart: stop using deprecated RTC API

Bartosz Golaszewski
2020-11-19T11:46:57Z

drivers/rtc/rtc-moxart.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c
index 6b24ac9e1cfa..f354bc8abecf 100644
--- a/drivers/rtc/rtc-moxart.c
+++ b/drivers/rtc/rtc-moxart.c
@@ -294,15 +294,13 @@ static int moxart_rtc_probe(struct platform_device *pdev)
return ret;
}

- moxart_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &moxart_rtc_ops,
- THIS_MODULE);
- if (IS_ERR(moxart_rtc->rtc)) {
- dev_err(&pdev->dev, "devm_rtc_device_register failed\n");
+ moxart_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(moxart_rtc->rtc))
return PTR_ERR(moxart_rtc->rtc);
- }

- return 0;
+ moxart_rtc->rtc->ops = &moxart_rtc_ops;
+
+ return devm_rtc_register_device(moxart_rtc->rtc);
}

static const struct of_device_id moxart_rtc_match[] = {
--
2.29.1