aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/power/main.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-06-18 14:22:23 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-06-21 17:19:50 -0400
commitf76b168b6f117a49d36307053e1acbe30580ea5b (patch)
tree2aa0cc19b27764d8eb55ce85eaf226a60ce27756 /drivers/base/power/main.c
parent78420884e680da8fbc3240de2d3106437042381e (diff)
PM: Rename dev_pm_info.in_suspend to is_prepared
This patch (as1473) renames the "in_suspend" field in struct dev_pm_info to "is_prepared", in preparation for an upcoming change. The new name is more descriptive of what the field really means. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Cc: stable@kernel.org
Diffstat (limited to 'drivers/base/power/main.c')
-rw-r--r--drivers/base/power/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index aa6320207745..bf5a59ac1957 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -57,7 +57,7 @@ static int async_error;
57 */ 57 */
58void device_pm_init(struct device *dev) 58void device_pm_init(struct device *dev)
59{ 59{
60 dev->power.in_suspend = false; 60 dev->power.is_prepared = false;
61 init_completion(&dev->power.completion); 61 init_completion(&dev->power.completion);
62 complete_all(&dev->power.completion); 62 complete_all(&dev->power.completion);
63 dev->power.wakeup = NULL; 63 dev->power.wakeup = NULL;
@@ -91,7 +91,7 @@ void device_pm_add(struct device *dev)
91 pr_debug("PM: Adding info for %s:%s\n", 91 pr_debug("PM: Adding info for %s:%s\n",
92 dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); 92 dev->bus ? dev->bus->name : "No Bus", dev_name(dev));
93 mutex_lock(&dpm_list_mtx); 93 mutex_lock(&dpm_list_mtx);
94 if (dev->parent && dev->parent->power.in_suspend) 94 if (dev->parent && dev->parent->power.is_prepared)
95 dev_warn(dev, "parent %s should not be sleeping\n", 95 dev_warn(dev, "parent %s should not be sleeping\n",
96 dev_name(dev->parent)); 96 dev_name(dev->parent));
97 list_add_tail(&dev->power.entry, &dpm_list); 97 list_add_tail(&dev->power.entry, &dpm_list);
@@ -511,7 +511,11 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)
511 dpm_wait(dev->parent, async); 511 dpm_wait(dev->parent, async);
512 device_lock(dev); 512 device_lock(dev);
513 513
514 dev->power.in_suspend = false; 514 /*
515 * This is a fib. But we'll allow new children to be added below
516 * a resumed device, even if the device hasn't been completed yet.
517 */
518 dev->power.is_prepared = false;
515 519
516 if (dev->pwr_domain) { 520 if (dev->pwr_domain) {
517 pm_dev_dbg(dev, state, "power domain "); 521 pm_dev_dbg(dev, state, "power domain ");
@@ -670,7 +674,7 @@ void dpm_complete(pm_message_t state)
670 struct device *dev = to_device(dpm_prepared_list.prev); 674 struct device *dev = to_device(dpm_prepared_list.prev);
671 675
672 get_device(dev); 676 get_device(dev);
673 dev->power.in_suspend = false; 677 dev->power.is_prepared = false;
674 list_move(&dev->power.entry, &list); 678 list_move(&dev->power.entry, &list);
675 mutex_unlock(&dpm_list_mtx); 679 mutex_unlock(&dpm_list_mtx);
676 680
@@ -1042,7 +1046,7 @@ int dpm_prepare(pm_message_t state)
1042 put_device(dev); 1046 put_device(dev);
1043 break; 1047 break;
1044 } 1048 }
1045 dev->power.in_suspend = true; 1049 dev->power.is_prepared = true;
1046 if (!list_empty(&dev->power.entry)) 1050 if (!list_empty(&dev->power.entry))
1047 list_move_tail(&dev->power.entry, &dpm_prepared_list); 1051 list_move_tail(&dev->power.entry, &dpm_prepared_list);
1048 put_device(dev); 1052 put_device(dev);