Commit 05b38d18 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: cpcap: convert to devm_rtc_allocate_device

This allows further improvement of the driver.

Link: https://lore.kernel.org/r/20200306015703.42101-1-alexandre.belloni@bootlin.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent eb8d9420
...@@ -256,12 +256,12 @@ static int cpcap_rtc_probe(struct platform_device *pdev) ...@@ -256,12 +256,12 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
platform_set_drvdata(pdev, rtc); platform_set_drvdata(pdev, rtc);
rtc->rtc_dev = devm_rtc_device_register(dev, "cpcap_rtc", rtc->rtc_dev = devm_rtc_allocate_device(dev);
&cpcap_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc->rtc_dev)) if (IS_ERR(rtc->rtc_dev))
return PTR_ERR(rtc->rtc_dev); return PTR_ERR(rtc->rtc_dev);
rtc->rtc_dev->ops = &cpcap_rtc_ops;
err = cpcap_get_vendor(dev, rtc->regmap, &rtc->vendor); err = cpcap_get_vendor(dev, rtc->regmap, &rtc->vendor);
if (err) if (err)
return err; return err;
...@@ -298,7 +298,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev) ...@@ -298,7 +298,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
/* ignore error and continue without wakeup support */ /* ignore error and continue without wakeup support */
} }
return 0; return rtc_register_device(rtc->rtc_dev);
} }
static const struct of_device_id cpcap_rtc_of_match[] = { static const struct of_device_id cpcap_rtc_of_match[] = {
......
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