rtc: pcf8563: clear RTC_FEATURE_ALARM if no irq

If there is no IRQ hooked up, clear RTC_FEATURE_ALARM to make the core
ensure that userspace is made aware that alarms are not supported.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20220301131220.4011810-1-vincent.whitchurch@axis.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Vincent Whitchurch 2022-03-01 14:12:20 +01:00 committed by Alexandre Belloni
parent 0462681e20
commit 60cfac17d0
1 changed files with 2 additions and 0 deletions

View File

@ -567,6 +567,8 @@ static int pcf8563_probe(struct i2c_client *client)
client->irq); client->irq);
return err; return err;
} }
} else {
clear_bit(RTC_FEATURE_ALARM, pcf8563->rtc->features);
} }
err = devm_rtc_register_device(pcf8563->rtc); err = devm_rtc_register_device(pcf8563->rtc);