diff options
author | Jon Hunter <jonathanh@nvidia.com> | 2016-03-04 10:55:14 +0000 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-03-09 00:41:06 +0100 |
commit | beda5fc1ff9b527059290a97b672d2ee0eb7b92f (patch) | |
tree | 9e382005247e2f4b4d90550852af87780e36f5bc /drivers/base | |
parent | 076395cae20381340a0e92ad3d76fe3e280f8a1c (diff) | |
download | linux-stable-beda5fc1ff9b527059290a97b672d2ee0eb7b92f.tar.gz linux-stable-beda5fc1ff9b527059290a97b672d2ee0eb7b92f.tar.bz2 linux-stable-beda5fc1ff9b527059290a97b672d2ee0eb7b92f.zip |
PM / Domains: Fix removal of a subdomain
Commit 30e7a65b3fdb (PM / Domains: Ensure subdomain is not in use
before removing) added a test to ensure that a subdomain is not a
master to another subdomain or if any devices are using the subdomain
before removing. This change incorrectly used the "slave_links" list to
determine if the subdomain is a master to another subdomain, where it
should have been using the "master_links" list instead. The
"slave_links" list will never be empty for a subdomain and so a
subdomain can never be removed. Fix this by testing if the
"master_links" list is empty instead.
Fixes: 30e7a65b3fdb (PM / Domains: Ensure subdomain is not in use before removing)
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/domain.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 7e44ae3366db..79f5d3965931 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1398,7 +1398,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd, mutex_lock(&subdomain->lock); mutex_lock_nested(&genpd->lock, SINGLE_DEPTH_NESTING); - if (!list_empty(&subdomain->slave_links) || subdomain->device_count) { + if (!list_empty(&subdomain->master_links) || subdomain->device_count) { pr_warn("%s: unable to remove subdomain %s\n", genpd->name, subdomain->name); ret = -EBUSY; |