From: Bartosz Golaszewski <[email protected]>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
 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

Reply via email to