diff mbox series

[38/59] rtc: rc5t583: stop using deprecated RTC API

Message ID 20201119114149.4117-39-brgl@bgdev.pl
State Rejected
Headers show
Series rtc: remove all uses of devm_rtc_device_register() | expand

Commit Message

Bartosz Golaszewski Nov. 19, 2020, 11:41 a.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.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@baylibre.com>
---
 drivers/rtc/rtc-rc5t583.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

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);
 }
 
 /*