summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1347.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-10-07 15:47:20 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-10-07 15:49:31 +0200
commit554692d56d74cd2e1de369570c242eb22c203c6d (patch)
tree5df6d7ab9f0956645eb4614f305c4dcbe2677d65 /drivers/rtc/rtc-ds1347.c
parentrtc: ds1347: mask ALM OUT when reading time (diff)
downloadlinux-554692d56d74cd2e1de369570c242eb22c203c6d.tar.xz
linux-554692d56d74cd2e1de369570c242eb22c203c6d.zip
rtc: ds1347: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Link: https://lore.kernel.org/r/20191007134724.15505-6-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1347.c')
-rw-r--r--drivers/rtc/rtc-ds1347.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c
index 763eb60e5e8f..75c522c8ab26 100644
--- a/drivers/rtc/rtc-ds1347.c
+++ b/drivers/rtc/rtc-ds1347.c
@@ -129,13 +129,13 @@ static int ds1347_probe(struct spi_device *spi)
data = data & 0x1B;
regmap_write(map, DS1347_STATUS_REG, data);
- rtc = devm_rtc_device_register(&spi->dev, "ds1347",
- &ds1347_rtc_ops, THIS_MODULE);
-
+ rtc = devm_rtc_allocate_device(&spi->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
- return 0;
+ rtc->ops = &ds1347_rtc_ops;
+
+ return rtc_register_device(rtc);
}
static struct spi_driver ds1347_driver = {