Re: [PATCH] alarmtimer: check RTC features instead of ops
From: Thomas Gleixner
Date: Fri Apr 30 2021 - 03:16:44 EST
On Thu, Apr 29 2021 at 23:49, Alexandre Belloni wrote:
> Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to know whether
> alarms are available.
>
> Fixes: 7ae41220ef58 ("rtc: introduce features bitfield")
> Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
> ---
> Hello,
>
> This doesn't seem much but this solve an issue where following a change in the
> RTC driver, this part of the code will think the RTC is alarm capable while it
> is not, then breaking the alarmtimer functionnality.
So a driver has the set_alarm() callback but does not advertise
RTC_FEATURE_ALARM for whatever reason and why ever this makes sense.
I don't mind the patch, but the changelog is a bit meager in explaining
the WHY.
Thanks,
tglx