Commit 4fac49fd authored by Alexandre Belloni's avatar Alexandre Belloni Committed by Rafael J. Wysocki

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: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d2c8cce6
...@@ -129,7 +129,7 @@ static int __init has_wakealarm(struct device *dev, const void *data) ...@@ -129,7 +129,7 @@ static int __init has_wakealarm(struct device *dev, const void *data)
{ {
struct rtc_device *candidate = to_rtc_device(dev); struct rtc_device *candidate = to_rtc_device(dev);
if (!candidate->ops->set_alarm) if (!test_bit(RTC_FEATURE_ALARM, candidate->features))
return 0; return 0;
if (!device_may_wakeup(candidate->dev.parent)) if (!device_may_wakeup(candidate->dev.parent))
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment