diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-21 00:42:59 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-01-21 00:42:59 +0100 |
commit | 6efd3f8cde1d6acc20a715ac6ea17e01421742df (patch) | |
tree | 5fc4caece6907a2ccdeb8b13b887a01d683d9803 /drivers/base/power/domain.c | |
parent | Merge branches 'acpica', 'acpi-video' and 'acpi-fan' (diff) | |
parent | driver core: Avoid NULL pointer dereferences in device_is_bound() (diff) | |
download | linux-6efd3f8cde1d6acc20a715ac6ea17e01421742df.tar.xz linux-6efd3f8cde1d6acc20a715ac6ea17e01421742df.zip |
Merge branch 'pm-core'
* pm-core:
driver core: Avoid NULL pointer dereferences in device_is_bound()
platform: Do not detach from PM domains on shutdown
USB / PM: Allow USB devices to remain runtime-suspended when sleeping
PM / sleep: Go direct_complete if driver has no callbacks
PM / Domains: add setter for dev.pm_domain
device core: add device_is_bound()
Diffstat (limited to 'drivers/base/power/domain.c')
-rw-r--r-- | drivers/base/power/domain.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index b80379012840..6ac9a7f33b64 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -20,6 +20,8 @@ #include <linux/suspend.h> #include <linux/export.h> +#include "power.h" + #define GENPD_RETRY_MAX_MS 250 /* Approximate */ #define GENPD_DEV_CALLBACK(genpd, type, callback, dev) \ @@ -1188,10 +1190,11 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, } dev->power.subsys_data->domain_data = &gpd_data->base; - dev->pm_domain = &genpd->domain; spin_unlock_irq(&dev->power.lock); + dev_pm_domain_set(dev, &genpd->domain); + return gpd_data; err_free: @@ -1205,9 +1208,10 @@ static struct generic_pm_domain_data *genpd_alloc_dev_data(struct device *dev, static void genpd_free_dev_data(struct device *dev, struct generic_pm_domain_data *gpd_data) { + dev_pm_domain_set(dev, NULL); + spin_lock_irq(&dev->power.lock); - dev->pm_domain = NULL; dev->power.subsys_data->domain_data = NULL; spin_unlock_irq(&dev->power.lock); |