]> git.baikalelectronics.ru Git - kernel.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)
commit5a4459260dd9217f5b0951e8b9fa76022ce0b9e9
tree41be7b5589e058fafc207fcba30a3c032ab49cf8
parentb2c33c6d06f1abf121705a0999092667885ef1f5
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