summaryrefslogtreecommitdiff
path: root/drivers/base/power/main.c
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2020-11-19 10:25:39 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-11-23 20:34:55 +0300
commit4e1d9a737d00f2cc811dc5654f82c92c7d80e98c (patch)
tree71088fb08b6d338b88fbab7de414d05c5452461e /drivers/base/power/main.c
parentab150c3f80dcce670926ab3ca412be5047011d22 (diff)
downloadlinux-4e1d9a737d00f2cc811dc5654f82c92c7d80e98c.tar.xz
PM: sleep: Add dev_wakeup_path() helper
Add dev_wakeup_path() helper to avoid to spread dev->power.wakeup_path test in drivers. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power/main.c')
-rw-r--r--drivers/base/power/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 2b4255dc101e..46793276598d 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1359,7 +1359,7 @@ static void dpm_propagate_wakeup_to_parent(struct device *dev)
spin_lock_irq(&parent->power.lock);
- if (dev->power.wakeup_path && !parent->power.ignore_children)
+ if (device_wakeup_path(dev) && !parent->power.ignore_children)
parent->power.wakeup_path = true;
spin_unlock_irq(&parent->power.lock);
@@ -1627,7 +1627,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)
goto Complete;
/* Avoid direct_complete to let wakeup_path propagate. */
- if (device_may_wakeup(dev) || dev->power.wakeup_path)
+ if (device_may_wakeup(dev) || device_wakeup_path(dev))
dev->power.direct_complete = false;
if (dev->power.direct_complete) {