summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-04 11:16:30 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-04 20:21:19 +0100
commit6515e23b9fdeb9a69caee79f6a71dd6d82125f66 (patch)
treea1cd171a213bbe64585ba4995fb72533acdad0b0 /drivers/rtc
parentrtc: update my email address (diff)
downloadlinux-6515e23b9fdeb9a69caee79f6a71dd6d82125f66.tar.xz
linux-6515e23b9fdeb9a69caee79f6a71dd6d82125f66.zip
rtc: pic32: 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')
-rw-r--r--drivers/rtc/rtc-pic32.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c
index d7ef0a6f8931..43bd701daef2 100644
--- a/drivers/rtc/rtc-pic32.c
+++ b/drivers/rtc/rtc-pic32.c
@@ -348,13 +348,15 @@ static int pic32_rtc_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);
- pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &pic32_rtcops,
- THIS_MODULE);
- if (IS_ERR(pdata->rtc)) {
- ret = PTR_ERR(pdata->rtc);
+ pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(pdata->rtc))
+ return PTR_ERR(pdata->rtc);
+
+ pdata->rtc->ops = &pic32_rtcops;
+
+ ret = rtc_register_device(pdata->rtc);
+ if (ret)
goto err_nortc;
- }
pdata->rtc->max_user_freq = 128;