[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-5-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:40:54 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH 04/59] rtc: ds3232: stop using deprecated RTC API
From: Bartosz Golaszewski <bgolaszewski@...libre.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@...libre.com>
---
drivers/rtc/rtc-ds3232.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-ds3232.c b/drivers/rtc/rtc-ds3232.c
index 16b89035d135..962f84b1ba66 100644
--- a/drivers/rtc/rtc-ds3232.c
+++ b/drivers/rtc/rtc-ds3232.c
@@ -513,11 +513,12 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
ds3232_hwmon_register(dev, name);
- ds3232->rtc = devm_rtc_device_register(dev, name, &ds3232_rtc_ops,
- THIS_MODULE);
+ ds3232->rtc = devm_rtc_allocate_device(dev);
if (IS_ERR(ds3232->rtc))
return PTR_ERR(ds3232->rtc);
+ ds3232->rtc->ops = &ds3232_rtc_ops;
+
ret = devm_rtc_nvmem_register(ds3232->rtc, &nvmem_cfg);
if(ret)
return ret;
@@ -534,7 +535,7 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
}
}
- return 0;
+ return devm_rtc_register_device(ds3232->rtc);
}
#ifdef CONFIG_PM_SLEEP
--
2.29.1
Powered by blists - more mailing lists