lkml.org 
[lkml]   [2019]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 04/12] rtc: pcf85063: convert to devm_rtc_allocate_device
Date
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/rtc/rtc-pcf85063.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index c4cc0abe37cb..afd98e863482 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -28,8 +28,6 @@
#define PCF85063_REG_SC 0x04 /* datetime */
#define PCF85063_REG_SC_OS 0x80

-static struct i2c_driver pcf85063_driver;
-
static int pcf85063_stop_clock(struct i2c_client *client, u8 *ctrl1)
{
int rc;
@@ -220,11 +218,13 @@ static int pcf85063_probe(struct i2c_client *client)
dev_warn(&client->dev, "failed to set xtal load capacitance: %d",
err);

- rtc = devm_rtc_device_register(&client->dev,
- pcf85063_driver.driver.name,
- &pcf85063_rtc_ops, THIS_MODULE);
+ rtc = devm_rtc_allocate_device(&client->dev);
+ if (IS_ERR(rtc))
+ return PTR_ERR(rtc);
+
+ rtc->ops = &pcf85063_rtc_ops;

- return PTR_ERR_OR_ZERO(rtc);
+ return rtc_register_device(rtc);
}

#ifdef CONFIG_OF
--
2.20.1
\
 
 \ /
  Last update: 2019-04-01 18:09    [W:0.093 / U:4.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site