Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267045
b: refs/heads/master
c: bc0403f
h: refs/heads/master
i:
  267043: b1cbb5c
v: v3
  • Loading branch information
Rafael J. Wysocki committed Aug 25, 2011
1 parent dbad023 commit 6a81245
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17877eb5a900f32bb5827a7b2109b6c9adff5fc3
refs/heads/master: bc0403ff16e5305c3a14c2b0826616ceaabbf058
26 changes: 13 additions & 13 deletions trunk/drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,36 +1178,36 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
/**
* pm_genpd_add_subdomain - Add a subdomain to an I/O PM domain.
* @genpd: Master PM domain to add the subdomain to.
* @new_subdomain: Subdomain to be added.
* @subdomain: Subdomain to be added.
*/
int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
struct generic_pm_domain *new_subdomain)
struct generic_pm_domain *subdomain)
{
struct gpd_link *link;
int ret = 0;

if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(new_subdomain))
if (IS_ERR_OR_NULL(genpd) || IS_ERR_OR_NULL(subdomain))
return -EINVAL;

start:
genpd_acquire_lock(genpd);
mutex_lock_nested(&new_subdomain->lock, SINGLE_DEPTH_NESTING);
mutex_lock_nested(&subdomain->lock, SINGLE_DEPTH_NESTING);

if (new_subdomain->status != GPD_STATE_POWER_OFF
&& new_subdomain->status != GPD_STATE_ACTIVE) {
mutex_unlock(&new_subdomain->lock);
if (subdomain->status != GPD_STATE_POWER_OFF
&& subdomain->status != GPD_STATE_ACTIVE) {
mutex_unlock(&subdomain->lock);
genpd_release_lock(genpd);
goto start;
}

if (genpd->status == GPD_STATE_POWER_OFF
&& new_subdomain->status != GPD_STATE_POWER_OFF) {
&& subdomain->status != GPD_STATE_POWER_OFF) {
ret = -EINVAL;
goto out;
}

list_for_each_entry(link, &genpd->slave_links, slave_node) {
if (link->slave == new_subdomain && link->master == genpd) {
if (link->slave == subdomain && link->master == genpd) {
ret = -EINVAL;
goto out;
}
Expand All @@ -1220,13 +1220,13 @@ int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
}
link->master = genpd;
list_add_tail(&link->master_node, &genpd->master_links);
link->slave = new_subdomain;
list_add_tail(&link->slave_node, &new_subdomain->slave_links);
if (new_subdomain->status != GPD_STATE_POWER_OFF)
link->slave = subdomain;
list_add_tail(&link->slave_node, &subdomain->slave_links);
if (subdomain->status != GPD_STATE_POWER_OFF)
genpd_sd_counter_inc(genpd);

out:
mutex_unlock(&new_subdomain->lock);
mutex_unlock(&subdomain->lock);
genpd_release_lock(genpd);

return ret;
Expand Down

0 comments on commit 6a81245

Please sign in to comment.