]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PM / Domains: Simplify genpd_lookup_dev()
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 29 Aug 2019 14:48:05 +0000 (16:48 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 2 Sep 2019 20:38:00 +0000 (22:38 +0200)
commitb3ad17c09899d491cf9815a6db44d3f9b3f244e7
tree41be7b5589e058fafc207fcba30a3c032ab49cf8
parent0d1e16c640ee67dcae65ae8e3c6f58e6d8101047
PM / Domains: Simplify genpd_lookup_dev()

genpd_lookup_dev(), is a bit unnecessary heavy, as it walks the gpd_list to
try to find a valid PM domain corresponding to the device's attached genpd.

Instead of walking the gpd_list, let's use the fact that a genpd always has
the ->runtime_suspend() callback assigned to the genpd_runtime_suspend()
function.

While changing this, let's take the opportunity to also rename
genpd_lookup_dev(), into dev_to_genpd_safe() to better reflect its purpose.

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