]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtc: rs5c348: remove forward declaration
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 24 Sep 2018 15:05:08 +0000 (17:05 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 28 Sep 2018 12:21:03 +0000 (14:21 +0200)
The name passed to devm_rtc_device_register is now unused. anyway, switch
to devm_rtc_allocate_device to avoid forward declaring rs5c348_driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-rs5c348.c

index aeb14fc0175dba2f38ef274f51b12167ca873dc0..7b9c7dc5b309fef186efba1e64c8bf83356a76c2 100644 (file)
@@ -143,8 +143,6 @@ static const struct rtc_class_ops rs5c348_rtc_ops = {
        .set_time       = rs5c348_rtc_set_time,
 };
 
-static struct spi_driver rs5c348_driver;
-
 static int rs5c348_probe(struct spi_device *spi)
 {
        int ret;
@@ -195,15 +193,15 @@ static int rs5c348_probe(struct spi_device *spi)
        if (ret & RS5C348_BIT_24H)
                pdata->rtc_24h = 1;
 
-       rtc = devm_rtc_device_register(&spi->dev, rs5c348_driver.driver.name,
-                                 &rs5c348_rtc_ops, THIS_MODULE);
-
+       rtc = devm_rtc_allocate_device(&spi->dev);
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
 
        pdata->rtc = rtc;
 
-       return 0;
+       rtc->ops = &rs5c348_rtc_ops;
+
+       return rtc_register_device(rtc);
 }
 
 static struct spi_driver rs5c348_driver = {