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-msm6242.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-msm6242.c b/drivers/rtc/rtc-msm6242.c
index 80e364baac53..b194f8bff403 100644
--- a/drivers/rtc/rtc-msm6242.c
+++ b/drivers/rtc/rtc-msm6242.c
@@ -205,13 +205,14 @@ static int __init msm6242_rtc_probe(struct 
platform_device *pdev)
                return -ENOMEM;
        platform_set_drvdata(pdev, priv);
 
-       rtc = devm_rtc_device_register(&pdev->dev, "rtc-msm6242",
-                               &msm6242_rtc_ops, THIS_MODULE);
+       rtc = devm_rtc_allocate_device(&pdev->dev);
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
 
+       rtc->ops = &msm6242_rtc_ops;
        priv->rtc = rtc;
-       return 0;
+
+       return devm_rtc_register_device(rtc);
 }
 
 static struct platform_driver msm6242_rtc_driver = {
-- 
2.29.1

Reply via email to