From: Alexandre Belloni Date: Wed, 4 Aug 2021 10:44:07 +0000 (+0200) Subject: PM: sleep: check RTC features instead of ops in suspend_test X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4fac49fd0a349aa3afb3ad7ec778a00592c7ab59;p=linux.git PM: sleep: check RTC features instead of ops in suspend_test Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to know whether alarms are available. Signed-off-by: Alexandre Belloni Signed-off-by: Rafael J. Wysocki --- diff --git a/kernel/power/suspend_test.c b/kernel/power/suspend_test.c index e1ed58adb69e4..d20526c5be15b 100644 --- a/kernel/power/suspend_test.c +++ b/kernel/power/suspend_test.c @@ -129,7 +129,7 @@ static int __init has_wakealarm(struct device *dev, const void *data) { struct rtc_device *candidate = to_rtc_device(dev); - if (!candidate->ops->set_alarm) + if (!test_bit(RTC_FEATURE_ALARM, candidate->features)) return 0; if (!device_may_wakeup(candidate->dev.parent)) return 0;