aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-r9701.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2020-10-15 21:11:34 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2020-10-19 22:48:55 +0200
commitdfe13cf2ae5a7cdb131e61a8aae4fb27cd379bd4 (patch)
treee4b8cf540e1a6c0c5321aee25c66842f00294700 /drivers/rtc/rtc-r9701.c
parent8b34134907e7d70b8b51fa56ecd4f8c50c46692c (diff)
downloadlinux-dfe13cf2ae5a7cdb131e61a8aae4fb27cd379bd4.tar.gz
rtc: r9701: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20201015191135.471249-5-alexandre.belloni@bootlin.com
Diffstat (limited to 'drivers/rtc/rtc-r9701.c')
-rw-r--r--drivers/rtc/rtc-r9701.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c
index 183c5a0fe78c3..9165c180b0e62 100644
--- a/drivers/rtc/rtc-r9701.c
+++ b/drivers/rtc/rtc-r9701.c
@@ -122,14 +122,14 @@ static int r9701_probe(struct spi_device *spi)
return -ENODEV;
}
- rtc = devm_rtc_device_register(&spi->dev, "r9701",
- &r9701_rtc_ops, THIS_MODULE);
+ rtc = devm_rtc_allocate_device(&spi->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
spi_set_drvdata(spi, rtc);
+ rtc->ops = &r9701_rtc_ops;
- return 0;
+ return rtc_register_device(rtc);
}
static struct spi_driver r9701_driver = {