PM / Domains: Check for existing PM domain in dev_pm_domain_attach()
Instead of checking if an existing PM domain pointer has been assigned in genpd_dev_pm_attach() and acpi_dev_pm_attach(), move the check to the common path in dev_pm_domain_attach(), thus potentially avoid one unnecessary check. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
b56d9c9135
commit
4f688748c9
@@ -104,6 +104,9 @@ int dev_pm_domain_attach(struct device *dev, bool power_on)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (dev->pm_domain)
|
||||
return -EEXIST;
|
||||
|
||||
ret = acpi_dev_pm_attach(dev, power_on);
|
||||
if (ret)
|
||||
ret = genpd_dev_pm_attach(dev);
|
||||
|
Reference in New Issue
Block a user