aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index b6e29ffbb70d..c3e4e2934e16 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -213,6 +213,19 @@ static bool genpd_abort_poweroff(struct generic_pm_domain *genpd)
213} 213}
214 214
215/** 215/**
216 * genpd_queue_power_off_work - Queue up the execution of pm_genpd_poweroff().
217 * @genpd: PM domait to power off.
218 *
219 * Queue up the execution of pm_genpd_poweroff() unless it's already been done
220 * before.
221 */
222static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
223{
224 if (!work_pending(&genpd->power_off_work))
225 queue_work(pm_wq, &genpd->power_off_work);
226}
227
228/**
216 * pm_genpd_poweroff - Remove power from a given PM domain. 229 * pm_genpd_poweroff - Remove power from a given PM domain.
217 * @genpd: PM domain to power down. 230 * @genpd: PM domain to power down.
218 * 231 *
@@ -304,7 +317,7 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
304 if (parent) { 317 if (parent) {
305 genpd_sd_counter_dec(parent); 318 genpd_sd_counter_dec(parent);
306 if (parent->sd_count == 0) 319 if (parent->sd_count == 0)
307 queue_work(pm_wq, &parent->power_off_work); 320 genpd_queue_power_off_work(parent);
308 321
309 genpd_release_lock(parent); 322 genpd_release_lock(parent);
310 } 323 }