summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ds1343.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-13 01:47:36 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-01 12:49:24 +0300
commit1536f6dc9d3b9d265c0333970e3a52874144b10f (patch)
tree659854b33510ef33ba772b88f83800fa2950411d /drivers/rtc/rtc-ds1343.c
parentb5086150a685dcf8a3a2943eb7677a5fc4186782 (diff)
downloadlinux-1536f6dc9d3b9d265c0333970e3a52874144b10f.tar.xz
rtc: ds1343: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1343.c')
-rw-r--r--drivers/rtc/rtc-ds1343.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c
index b5102cdd7f61..a5a5a363c6e1 100644
--- a/drivers/rtc/rtc-ds1343.c
+++ b/drivers/rtc/rtc-ds1343.c
@@ -642,12 +642,15 @@ static int ds1343_probe(struct spi_device *spi)
data &= ~(DS1343_OSF | DS1343_IRQF1 | DS1343_IRQF0);
regmap_write(priv->map, DS1343_STATUS_REG, data);
- priv->rtc = devm_rtc_device_register(&spi->dev, "ds1343",
- &ds1343_rtc_ops, THIS_MODULE);
- if (IS_ERR(priv->rtc)) {
- dev_err(&spi->dev, "unable to register rtc ds1343\n");
+ priv->rtc = devm_rtc_allocate_device(&spi->dev);
+ if (IS_ERR(priv->rtc))
return PTR_ERR(priv->rtc);
- }
+
+ priv->rtc->ops = &ds1343_rtc_ops;
+
+ res = rtc_register_device(priv->rtc);
+ if (res)
+ return res;
priv->irq = spi->irq;