aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-pcf85063.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-01 18:08:08 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-04 10:07:11 +0200
commit3555a3425822601ea16a3508b803fa7c1158cba0 (patch)
tree06b0c9a9a43486aabd43238f646d66ed75f2d2a6 /drivers/rtc/rtc-pcf85063.c
parent191c0da112e0e880587c50b692beff7ba5300a75 (diff)
downloadlinux-3555a3425822601ea16a3508b803fa7c1158cba0.tar.gz
rtc: pcf85063: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-pcf85063.c')
-rw-r--r--drivers/rtc/rtc-pcf85063.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index 559333197fa56..7736bf99d57a9 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