Skip to content

Commit 4d0185e

Browse files
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e463786 commit 4d0185e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static bool rtc_does_wakealarm(struct rtc_device *rtc)
273273
if (!device_can_wakeup(rtc->dev.parent))
274274
return false;
275275

276-
return rtc->ops->set_alarm != NULL;
276+
return !!test_bit(RTC_FEATURE_ALARM, rtc->features);
277277
}
278278

279279
static umode_t rtc_attr_is_visible(struct kobject *kobj,

0 commit comments

Comments
 (0)