1
0
Fork 0

rtc: ps3: convert to devm_rtc_allocate_device

This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
hifive-unleashed-5.2
Alexandre Belloni 2019-03-20 13:44:27 +01:00
parent e85b930bc6
commit 0b5e47bbaa
1 changed files with 5 additions and 3 deletions

View File

@ -47,13 +47,15 @@ static int __init ps3_rtc_probe(struct platform_device *dev)
{
struct rtc_device *rtc;
rtc = devm_rtc_device_register(&dev->dev, "rtc-ps3", &ps3_rtc_ops,
THIS_MODULE);
rtc = devm_rtc_allocate_device(&dev->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);
rtc->ops = &ps3_rtc_ops;
platform_set_drvdata(dev, rtc);
return 0;
return rtc_register_device(rtc);
}
static struct platform_driver ps3_rtc_driver = {