Commit bac68b30 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: ep93xx: convert to devm_rtc_allocate_device

This allows further improvement of the driver.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent b809d192
...@@ -138,11 +138,16 @@ static int ep93xx_rtc_probe(struct platform_device *pdev) ...@@ -138,11 +138,16 @@ static int ep93xx_rtc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ep93xx_rtc); platform_set_drvdata(pdev, ep93xx_rtc);
ep93xx_rtc->rtc = devm_rtc_device_register(&pdev->dev, ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
pdev->name, &ep93xx_rtc_ops, THIS_MODULE);
if (IS_ERR(ep93xx_rtc->rtc)) if (IS_ERR(ep93xx_rtc->rtc))
return PTR_ERR(ep93xx_rtc->rtc); return PTR_ERR(ep93xx_rtc->rtc);
ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops;
err = rtc_register_device(ep93xx_rtc->rtc);
if (err)
return err;
err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
if (err) if (err)
return err; return err;
......
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