Merge branches 'pm-core' and 'pm-domains'

* pm-core:
  PM: Avoid false-positive warnings in dev_pm_domain_set()
  ACPI / LPSS: set PM domain via helper setter

* pm-domains:
  PM / Domains: Silence compiler warning for an unused function
This commit is contained in:
Rafael J. Wysocki 2016-02-06 00:34:01 +01:00
commit 79e2f8dd52
3 changed files with 9 additions and 22 deletions

View File

@ -880,7 +880,7 @@ static int acpi_lpss_platform_notify(struct notifier_block *nb,
break;
case BUS_NOTIFY_DRIVER_NOT_BOUND:
case BUS_NOTIFY_UNBOUND_DRIVER:
pdev->dev.pm_domain = NULL;
dev_pm_domain_set(&pdev->dev, NULL);
break;
case BUS_NOTIFY_ADD_DEVICE:
dev_pm_domain_set(&pdev->dev, &acpi_lpss_pm_domain);

View File

@ -146,7 +146,7 @@ void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd)
if (dev->pm_domain == pd)
return;
WARN(device_is_bound(dev),
WARN(pd && device_is_bound(dev),
"PM domains can only be changed for unbound devices\n");
dev->pm_domain = pd;
device_pm_check_callbacks(dev);

View File

@ -173,14 +173,14 @@ static void genpd_queue_power_off_work(struct generic_pm_domain *genpd)
}
/**
* __genpd_poweron - Restore power to a given PM domain and its masters.
* genpd_poweron - Restore power to a given PM domain and its masters.
* @genpd: PM domain to power up.
* @depth: nesting count for lockdep.
*
* Restore power to @genpd and all of its masters so that it is possible to
* resume a device belonging to it.
*/
static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
static int genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
{
struct gpd_link *link;
int ret = 0;
@ -200,7 +200,7 @@ static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
genpd_sd_counter_inc(master);
mutex_lock_nested(&master->lock, depth + 1);
ret = __genpd_poweron(master, depth + 1);
ret = genpd_poweron(master, depth + 1);
mutex_unlock(&master->lock);
if (ret) {
@ -227,21 +227,6 @@ static int __genpd_poweron(struct generic_pm_domain *genpd, unsigned int depth)
return ret;
}
/**
* genpd_poweron - Restore power to a given PM domain and its masters.
* @genpd: PM domain to power up.
*/
static int genpd_poweron(struct generic_pm_domain *genpd)
{
int ret;
mutex_lock(&genpd->lock);
ret = __genpd_poweron(genpd, 0);
mutex_unlock(&genpd->lock);
return ret;
}
static int genpd_save_dev(struct generic_pm_domain *genpd, struct device *dev)
{
return GENPD_DEV_CALLBACK(genpd, int, save_state, dev);
@ -489,7 +474,7 @@ static int pm_genpd_runtime_resume(struct device *dev)
}
mutex_lock(&genpd->lock);
ret = __genpd_poweron(genpd, 0);
ret = genpd_poweron(genpd, 0);
mutex_unlock(&genpd->lock);
if (ret)
@ -1821,8 +1806,10 @@ int genpd_dev_pm_attach(struct device *dev)
dev->pm_domain->detach = genpd_dev_pm_detach;
dev->pm_domain->sync = genpd_dev_pm_sync;
ret = genpd_poweron(pd);
mutex_lock(&pd->lock);
ret = genpd_poweron(pd, 0);
mutex_unlock(&pd->lock);
out:
return ret ? -EPROBE_DEFER : 0;
}