Skip to content

Commit 4fac49f

Browse files
alexandrebellonirafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent d2c8cce commit 4fac49f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/power/suspend_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int __init has_wakealarm(struct device *dev, const void *data)
129129
{
130130
struct rtc_device *candidate = to_rtc_device(dev);
131131

132-
if (!candidate->ops->set_alarm)
132+
if (!test_bit(RTC_FEATURE_ALARM, candidate->features))
133133
return 0;
134134
if (!device_may_wakeup(candidate->dev.parent))
135135
return 0;

0 commit comments

Comments
 (0)