mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 19:27:13 +00:00
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
This commit is contained in:
parent
8b34134907
commit
dfe13cf2ae
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user