Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+1 -1
+1 -1
drivers/rtc/sysfs.c
··· 273 273 if (!device_can_wakeup(rtc->dev.parent)) 274 274 return false; 275 275 276 - return rtc->ops->set_alarm != NULL; 276 + return !!test_bit(RTC_FEATURE_ALARM, rtc->features); 277 277 } 278 278 279 279 static umode_t rtc_attr_is_visible(struct kobject *kobj,