Commit 6515e23b authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: pic32: convert to devm_rtc_allocate_device

This allows further improvement of the driver.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 7d1e5bfe
...@@ -348,13 +348,15 @@ static int pic32_rtc_probe(struct platform_device *pdev) ...@@ -348,13 +348,15 @@ static int pic32_rtc_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1); device_init_wakeup(&pdev->dev, 1);
pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
&pic32_rtcops, if (IS_ERR(pdata->rtc))
THIS_MODULE); return PTR_ERR(pdata->rtc);
if (IS_ERR(pdata->rtc)) {
ret = PTR_ERR(pdata->rtc); pdata->rtc->ops = &pic32_rtcops;
ret = rtc_register_device(pdata->rtc);
if (ret)
goto err_nortc; goto err_nortc;
}
pdata->rtc->max_user_freq = 128; pdata->rtc->max_user_freq = 128;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment