summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2018-06-27 16:29:50 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2018-11-05 07:40:43 +0530
commit4c6a343e57fe241fa30ab31ac4969561272cc6b2 (patch)
tree214b1413c1246e5c66d1c2c2df5aa6130d409847 /drivers/base
parentca1b5d77b1c69df7d7b92860c61daa82c8bfde34 (diff)
downloadlinux-4c6a343e57fe241fa30ab31ac4969561272cc6b2.tar.bz2
OPP: Rename and relocate of_genpd_opp_to_performance_state()
The OPP core already has the performance state values for each of the genpd's OPPs and there is no need to call the genpd callback again to get the performance state for the case where the end device doesn't have an OPP table and has the "required-opps" property directly in its node. This commit renames of_genpd_opp_to_performance_state() as of_get_required_opp_performance_state() and moves it to the OPP core, as it is all about OPP stuff now. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 7be8c94c6b7f..8e554e6a82a2 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2552,54 +2552,6 @@ unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev,
}
EXPORT_SYMBOL_GPL(pm_genpd_opp_to_performance_state);
-/**
- * of_genpd_opp_to_performance_state- Gets performance state of device's
- * power domain corresponding to a DT node's "required-opps" property.
- *
- * @dev: Device for which the performance-state needs to be found.
- * @np: DT node where the "required-opps" property is present. This can be
- * the device node itself (if it doesn't have an OPP table) or a node
- * within the OPP table of a device (if device has an OPP table).
- *
- * Returns performance state corresponding to the "required-opps" property of
- * a DT node. This calls platform specific genpd->opp_to_performance_state()
- * callback to translate power domain OPP to performance state.
- *
- * Returns performance state on success and 0 on failure.
- */
-unsigned int of_genpd_opp_to_performance_state(struct device *dev,
- struct device_node *np)
-{
- struct generic_pm_domain *genpd;
- struct dev_pm_opp *opp;
- int state = 0;
-
- genpd = dev_to_genpd(dev);
- if (IS_ERR(genpd))
- return 0;
-
- if (unlikely(!genpd->set_performance_state))
- return 0;
-
- genpd_lock(genpd);
-
- opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np);
- if (IS_ERR(opp)) {
- dev_err(dev, "Failed to find required OPP: %ld\n",
- PTR_ERR(opp));
- goto unlock;
- }
-
- state = genpd->opp_to_performance_state(genpd, opp);
- dev_pm_opp_put(opp);
-
-unlock:
- genpd_unlock(genpd);
-
- return state;
-}
-EXPORT_SYMBOL_GPL(of_genpd_opp_to_performance_state);
-
static int __init genpd_bus_init(void)
{
return bus_register(&genpd_bus_type);