[PATCH 56/59] rtc: msm6242: stop using deprecated RTC API

Bartosz Golaszewski
2020-11-19T11:44:18Z

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