Commit dfe13cf2 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: r9701: convert to devm_rtc_allocate_device

This allows further improvement of the driver.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201015191135.471249-5-alexandre.belloni@bootlin.com
parent 8b341349
...@@ -122,14 +122,14 @@ static int r9701_probe(struct spi_device *spi) ...@@ -122,14 +122,14 @@ static int r9701_probe(struct spi_device *spi)
return -ENODEV; return -ENODEV;
} }
rtc = devm_rtc_device_register(&spi->dev, "r9701", rtc = devm_rtc_allocate_device(&spi->dev);
&r9701_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) if (IS_ERR(rtc))
return PTR_ERR(rtc); return PTR_ERR(rtc);
spi_set_drvdata(spi, rtc); spi_set_drvdata(spi, rtc);
rtc->ops = &r9701_rtc_ops;
return 0; return rtc_register_device(rtc);
} }
static struct spi_driver r9701_driver = { static struct spi_driver r9701_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment