Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08119e89 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Linus Torvalds
Browse files

Relax check on adding children of suspended devices



Do not refuse to actually register children of suspended devices,
but still warn about attempts to do that.

Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aca239b7
Loading
Loading
Loading
Loading
+6 −9
Original line number Original line Diff line number Diff line
@@ -62,7 +62,7 @@ static bool all_sleeping;
 */
 */
int device_pm_add(struct device *dev)
int device_pm_add(struct device *dev)
{
{
	int error = 0;
	int error;


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