Message ID | 20240902054959.28073-1-00107082@163.com |
---|---|
State | New |
Headers | show |
Series | PM: add: move warn message out of mutex lock. | expand |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 4a67e83300e1..934e5bb61f13 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -134,10 +134,10 @@ void device_pm_add(struct device *dev) pr_debug("Adding info for %s:%s\n", dev->bus ? dev->bus->name : "No Bus", dev_name(dev)); device_pm_check_callbacks(dev); - mutex_lock(&dpm_list_mtx); if (dev->parent && dev->parent->power.is_prepared) dev_warn(dev, "parent %s should not be sleeping\n", dev_name(dev->parent)); + mutex_lock(&dpm_list_mtx); list_add_tail(&dev->power.entry, &dpm_list); dev->power.in_dpm_list = true; mutex_unlock(&dpm_list_mtx);