From: Alexandre Belloni Date: Thu, 15 Oct 2020 19:11:34 +0000 (+0200) Subject: rtc: r9701: convert to devm_rtc_allocate_device X-Git-Tag: v5.10.7~1359^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfe13cf2ae5a7cdb131e61a8aae4fb27cd379bd4;p=platform%2Fkernel%2Flinux-rpi.git rtc: r9701: convert to devm_rtc_allocate_device This allows further improvement of the driver. Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20201015191135.471249-5-alexandre.belloni@bootlin.com --- diff --git a/drivers/rtc/rtc-r9701.c b/drivers/rtc/rtc-r9701.c index 183c5a0..9165c18 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 = {