summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-tx4939.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-12 23:47:57 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-01 10:49:34 +0100
commit68981fd1515de16f8effdd39e81f9a6084a895f7 (patch)
tree33c94185be6edc3735b3e3dd8aa5473fef680aac /drivers/rtc/rtc-tx4939.c
parentfaec5f7bcca3a2e81aa7bd8412b22e808df508c3 (diff)
rtc: tx4939: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-tx4939.c')
-rw-r--r--drivers/rtc/rtc-tx4939.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-tx4939.c b/drivers/rtc/rtc-tx4939.c
index 1f4013d8ae7b..75c3887fbc6c 100644
--- a/drivers/rtc/rtc-tx4939.c
+++ b/drivers/rtc/rtc-tx4939.c
@@ -283,10 +283,16 @@ static int __init tx4939_rtc_probe(struct platform_device *pdev)
if (devm_request_irq(&pdev->dev, irq, tx4939_rtc_interrupt,
0, pdev->name, &pdev->dev) < 0)
return -EBUSY;
- rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &tx4939_rtc_ops, THIS_MODULE);
+ rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
+
+ rtc->ops = &tx4939_rtc_ops;
+
+ ret = rtc_register_device(rtc);
+ if (ret)
+ return ret;
+
pdata->rtc = rtc;
ret = sysfs_create_bin_file(&pdev->dev.kobj, &tx4939_rtc_nvram_attr);