Commit 68981fd1 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: tx4939: switch to rtc_register_device

This allows for future improvement of the driver.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent faec5f7b
...@@ -283,10 +283,16 @@ static int __init tx4939_rtc_probe(struct platform_device *pdev) ...@@ -283,10 +283,16 @@ static int __init tx4939_rtc_probe(struct platform_device *pdev)
if (devm_request_irq(&pdev->dev, irq, tx4939_rtc_interrupt, if (devm_request_irq(&pdev->dev, irq, tx4939_rtc_interrupt,
0, pdev->name, &pdev->dev) < 0) 0, pdev->name, &pdev->dev) < 0)
return -EBUSY; return -EBUSY;
rtc = devm_rtc_device_register(&pdev->dev, pdev->name, rtc = devm_rtc_allocate_device(&pdev->dev);
&tx4939_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) if (IS_ERR(rtc))
return PTR_ERR(rtc); return PTR_ERR(rtc);
rtc->ops = &tx4939_rtc_ops;
ret = rtc_register_device(rtc);
if (ret)
return ret;
pdata->rtc = rtc; pdata->rtc = rtc;
ret = sysfs_create_bin_file(&pdev->dev.kobj, &tx4939_rtc_nvram_attr); ret = sysfs_create_bin_file(&pdev->dev.kobj, &tx4939_rtc_nvram_attr);
......
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