Commit dae68c6b authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: s5m: switch to devm_rtc_allocate_device

Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows
for further improvement of the driver.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210804104133.5158-1-alexandre.belloni@bootlin.com
parent e73f0f0e
......@@ -788,12 +788,16 @@ static int s5m_rtc_probe(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, 1);
info->rtc_dev = devm_rtc_device_register(&pdev->dev, "s5m-rtc",
&s5m_rtc_ops, THIS_MODULE);
info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(info->rtc_dev))
return PTR_ERR(info->rtc_dev);
info->rtc_dev->ops = &s5m_rtc_ops;
err = devm_rtc_register_device(info->rtc_dev);
if (err)
return err;
if (!info->irq) {
dev_info(&pdev->dev, "Alarm IRQ not available\n");
return 0;
......
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