PM / Domains: Make pm_genpd_poweron() always survive parent removal
commit9e08cf429697090d0fac57d493dc7b6de17a5eee
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 8 Aug 2011 21:43:22 +0000 (8 23:43 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Thu, 25 Aug 2011 13:33:44 +0000 (25 15:33 +0200)
tree70b18a96a5510bdec9bd35307bbf9d3b3e57981d
parent3c07cbc488bfd1ad1abf64d09cc692339b5f8a83
PM / Domains: Make pm_genpd_poweron() always survive parent removal

If pm_genpd_remove_subdomain() is called to remove a PM domain's
subdomain and pm_genpd_poweron() is called for that subdomain at
the same time, and the pm_genpd_poweron() called by it recursively
for the parent returns an error, the first pm_genpd_poweron()'s
error code path will attempt to decrement the subdomain counter of
a PM domain that it's not a subdomain of any more.

Rearrange the code in pm_genpd_poweron() to prevent this from
happening.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
drivers/base/power/domain.c