lkml.org 
[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] rtc: rs5c348: remove forward declaration
Date
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 | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-rs5c348.c b/drivers/rtc/rtc-rs5c348.c
index aeb14fc0175d..7b9c7dc5b309 100644
--- a/drivers/rtc/rtc-rs5c348.c
+++ b/drivers/rtc/rtc-rs5c348.c
@@ -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 = {
--
2.19.0
\
 
 \ /
  Last update: 2018-09-24 17:06    [W:0.045 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site