mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
rtc: da9052: convert to devm_rtc_allocate_device
This allows further improvement of the driver. Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/20200329224240.776568-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
a29de86521
commit
d17077e570
1 changed files with 7 additions and 3 deletions
|
@ -298,12 +298,16 @@ static int da9052_rtc_probe(struct platform_device *pdev)
|
|||
rtc_err(rtc, "Failed to disable TICKS: %d\n", ret);
|
||||
|
||||
device_init_wakeup(&pdev->dev, true);
|
||||
rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
|
||||
&da9052_rtc_ops, THIS_MODULE);
|
||||
|
||||
rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
|
||||
if (IS_ERR(rtc->rtc))
|
||||
return PTR_ERR(rtc->rtc);
|
||||
|
||||
rtc->rtc->ops = &da9052_rtc_ops;
|
||||
|
||||
ret = rtc_register_device(rtc->rtc);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = da9052_request_irq(rtc->da9052, DA9052_IRQ_ALARM, "ALM",
|
||||
da9052_rtc_irq, rtc);
|
||||
if (ret != 0) {
|
||||
|
|
Loading…
Reference in a new issue