]> Git Repo - linux.git/commitdiff
rtc: sysfs: check features instead of ops
authorAlexandre Belloni <[email protected]>
Thu, 29 Apr 2021 21:44:03 +0000 (23:44 +0200)
committerAlexandre Belloni <[email protected]>
Thu, 29 Apr 2021 21:51:18 +0000 (23:51 +0200)
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]
drivers/rtc/sysfs.c

index 8a957d31a1a4a77d8771b583ae32163cf840580e..74026f67fdfb07fbfdd6ebdf079a9bc292b2e42f 100644 (file)
@@ -273,7 +273,7 @@ static bool rtc_does_wakealarm(struct rtc_device *rtc)
        if (!device_can_wakeup(rtc->dev.parent))
                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,
This page took 0.057057 seconds and 4 git commands to generate.