Commit 1ed4dba2 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: s5m: signal the core when alarm are not available

Clear the RTC_FEATURE_ALARM bit to signal to the core when alarms are not
available to ensure the alarm callbacks are never called and userspace is
aware alarms are not supported.
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-2-alexandre.belloni@bootlin.com
parent dae68c6b
...@@ -794,25 +794,20 @@ static int s5m_rtc_probe(struct platform_device *pdev) ...@@ -794,25 +794,20 @@ static int s5m_rtc_probe(struct platform_device *pdev)
info->rtc_dev->ops = &s5m_rtc_ops; info->rtc_dev->ops = &s5m_rtc_ops;
err = devm_rtc_register_device(info->rtc_dev);
if (err)
return err;
if (!info->irq) { if (!info->irq) {
dev_info(&pdev->dev, "Alarm IRQ not available\n"); clear_bit(RTC_FEATURE_ALARM, info->rtc_dev->features);
return 0; } else {
} ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL,
s5m_rtc_alarm_irq, 0, "rtc-alarm0",
ret = devm_request_threaded_irq(&pdev->dev, info->irq, NULL, info);
s5m_rtc_alarm_irq, 0, "rtc-alarm0", if (ret < 0) {
info); dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n",
if (ret < 0) { info->irq, ret);
dev_err(&pdev->dev, "Failed to request alarm IRQ: %d: %d\n", return ret;
info->irq, ret); }
return ret;
} }
return 0; return devm_rtc_register_device(info->rtc_dev);
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
......
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