Skip to content

Commit

Permalink
Relax check on adding children of suspended devices
Browse files Browse the repository at this point in the history
Do not refuse to actually register children of suspended devices,
but still warn about attempts to do that.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Apr 23, 2008
1 parent aca239b commit 08119e8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions drivers/base/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,23 @@ static bool all_sleeping;
*/
int device_pm_add(struct device *dev)
{
int error = 0;
int error;

pr_debug("PM: Adding info for %s:%s\n",
dev->bus ? dev->bus->name : "No Bus",
kobject_name(&dev->kobj));
mutex_lock(&dpm_list_mtx);
if ((dev->parent && dev->parent->power.sleeping) || all_sleeping) {
if (dev->parent->power.sleeping)
dev_warn(dev,
"parent %s is sleeping, will not add\n",
dev_warn(dev, "parent %s is sleeping\n",
dev->parent->bus_id);
else
dev_warn(dev, "devices are sleeping, will not add\n");
dev_warn(dev, "all devices are sleeping\n");
WARN_ON(true);
error = -EBUSY;
} else {
error = dpm_sysfs_add(dev);
if (!error)
list_add_tail(&dev->power.entry, &dpm_active);
}
error = dpm_sysfs_add(dev);
if (!error)
list_add_tail(&dev->power.entry, &dpm_active);
mutex_unlock(&dpm_list_mtx);
return error;
}
Expand Down

0 comments on commit 08119e8

Please sign in to comment.