PM / Domains: Simplify detaching a device from its genpd
commit85168d56cc8603963cfdda1e2b9e8f9b68aef867
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 21 Sep 2016 13:38:50 +0000 (21 15:38 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 23 Sep 2016 23:54:28 +0000 (24 01:54 +0200)
tree126d44219109a7733848f7a4615aff193e9fac7d
parent609bed67bd8f72981faba75d80b3b48d746b7206
PM / Domains: Simplify detaching a device from its genpd

There's no need to validate the PM domain by using genpd_lookup_dev() when
removing the device via genpd's genpd_dev_pm_detach() function. That's
because this function can't be called, unless there is a valid PM domain
for the device.

To simplify the behaviour, let's move code from pm_genpd_remove_device()
into a new internal function, genpd_remove_device(), which is called from
pm_genpd_remove_device() and genpd_dev_pm_detach().

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Lina Iyer <lina.iyer@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/domain.c