summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-rv3029c2.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-12-14 23:10:18 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-12-18 10:38:06 +0100
commit9346f870664332f01b7e375e0d35c76cebb7dc5d (patch)
treec9fe4347c6c9d8182f109ccba28b1be220818187 /drivers/rtc/rtc-rv3029c2.c
parentcff2e4d278265b595864f882f17f60509713c913 (diff)
rtc: rv3029: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Link: https://lore.kernel.org/r/20191214221022.622482-13-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-rv3029c2.c')
-rw-r--r--drivers/rtc/rtc-rv3029c2.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index afe1d3bb6084..686a0d0e212a 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -731,12 +731,9 @@ static int rv3029_probe(struct device *dev, struct regmap *regmap, int irq,
rv3029_trickle_config(dev);
rv3029_hwmon_register(dev, name);
- rv3029->rtc = devm_rtc_device_register(dev, name, &rv3029_rtc_ops,
- THIS_MODULE);
- if (IS_ERR(rv3029->rtc)) {
- dev_err(dev, "unable to register the class device\n");
+ rv3029->rtc = devm_rtc_allocate_device(dev);
+ if (IS_ERR(rv3029->rtc))
return PTR_ERR(rv3029->rtc);
- }
if (rv3029->irq > 0) {
rc = devm_request_threaded_irq(dev, rv3029->irq,
@@ -753,7 +750,9 @@ static int rv3029_probe(struct device *dev, struct regmap *regmap, int irq,
}
}
- return 0;
+ rv3029->rtc->ops = &rv3029_rtc_ops;
+
+ return rtc_register_device(rv3029->rtc);
}
static const struct regmap_range rv3029_holes_range[] = {