lkml.org 
[lkml]   [2020]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 50/59] rtc: v3020: stop using deprecated RTC API
Date
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-v3020.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c
index d2da92187d56..e947cd1538a9 100644
--- a/drivers/rtc/rtc-v3020.c
+++ b/drivers/rtc/rtc-v3020.c
@@ -329,13 +329,18 @@ static int rtc_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, chip);

- chip->rtc = devm_rtc_device_register(&pdev->dev, "v3020",
- &v3020_rtc_ops, THIS_MODULE);
+ chip->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(chip->rtc)) {
retval = PTR_ERR(chip->rtc);
goto err_io;
}

+ chip->rtc->ops = &v3020_rtc_ops;
+
+ retval = devm_rtc_register_device(chip->rtc);
+ if (retval)
+ goto err_io;
+
return 0;

err_io:
--
2.29.1
\
 
 \ /
  Last update: 2020-11-19 13:10    [W:0.183 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site