rtc: sysfs: check features instead of ops
Test RTC_FEATURE_ALARM instead of relying on .set_alarm to know whether alarms are available. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20210429214403.2610952-1-alexandre.belloni@bootlin.com
This commit is contained in:
Родитель
e463786f38
Коммит
4d0185e678
|
@ -273,7 +273,7 @@ static bool rtc_does_wakealarm(struct rtc_device *rtc)
|
||||||
if (!device_can_wakeup(rtc->dev.parent))
|
if (!device_can_wakeup(rtc->dev.parent))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return rtc->ops->set_alarm != NULL;
|
return !!test_bit(RTC_FEATURE_ALARM, rtc->features);
|
||||||
}
|
}
|
||||||
|
|
||||||
static umode_t rtc_attr_is_visible(struct kobject *kobj,
|
static umode_t rtc_attr_is_visible(struct kobject *kobj,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче