[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-39-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:28 +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 38/59] rtc: rc5t583: 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-rc5t583.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/rtc/rtc-rc5t583.c b/drivers/rtc/rtc-rc5t583.c
index 18684a7026c4..20f150ab6bdb 100644
--- a/drivers/rtc/rtc-rc5t583.c
+++ b/drivers/rtc/rtc-rc5t583.c
@@ -247,15 +247,13 @@ static int rc5t583_rtc_probe(struct platform_device *pdev)
}
device_init_wakeup(&pdev->dev, 1);
- ricoh_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &rc5t583_rtc_ops, THIS_MODULE);
- if (IS_ERR(ricoh_rtc->rtc)) {
- ret = PTR_ERR(ricoh_rtc->rtc);
- dev_err(&pdev->dev, "RTC device register: err %d\n", ret);
- return ret;
- }
+ ricoh_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(ricoh_rtc->rtc))
+ return PTR_ERR(ricoh_rtc->rtc);
- return 0;
+ ricoh_rtc->rtc->ops = &rc5t583_rtc_ops;
+
+ return devm_rtc_register_device(ricoh_rtc->rtc);
}
/*
--
2.29.1
Powered by blists - more mailing lists