Commit a1317e09 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

cpufreq: Rename __cpufreq_governor() to cpufreq_governor()

The __ at the beginning of the routine aren't really necessary at all.
Rename it to cpufreq_governor() instead.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 11eb69b9
...@@ -156,8 +156,7 @@ static inline bool has_target(void) ...@@ -156,8 +156,7 @@ static inline bool has_target(void)
} }
/* internal prototypes */ /* internal prototypes */
static int __cpufreq_governor(struct cpufreq_policy *policy, static int cpufreq_governor(struct cpufreq_policy *policy, unsigned int event);
unsigned int event);
static unsigned int __cpufreq_get(struct cpufreq_policy *policy); static unsigned int __cpufreq_get(struct cpufreq_policy *policy);
/** /**
...@@ -1048,7 +1047,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cp ...@@ -1048,7 +1047,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cp
down_write(&policy->rwsem); down_write(&policy->rwsem);
if (has_target()) { if (has_target()) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
if (ret) { if (ret) {
pr_err("%s: Failed to stop governor\n", __func__); pr_err("%s: Failed to stop governor\n", __func__);
goto unlock; goto unlock;
...@@ -1058,9 +1057,9 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cp ...@@ -1058,9 +1057,9 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cp
cpumask_set_cpu(cpu, policy->cpus); cpumask_set_cpu(cpu, policy->cpus);
if (has_target()) { if (has_target()) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
if (!ret) if (!ret)
ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); ret = cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
if (ret) if (ret)
pr_err("%s: Failed to start governor\n", __func__); pr_err("%s: Failed to start governor\n", __func__);
...@@ -1382,7 +1381,7 @@ static void cpufreq_offline(unsigned int cpu) ...@@ -1382,7 +1381,7 @@ static void cpufreq_offline(unsigned int cpu)
down_write(&policy->rwsem); down_write(&policy->rwsem);
if (has_target()) { if (has_target()) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
if (ret) if (ret)
pr_err("%s: Failed to stop governor\n", __func__); pr_err("%s: Failed to stop governor\n", __func__);
} }
...@@ -1403,9 +1402,9 @@ static void cpufreq_offline(unsigned int cpu) ...@@ -1403,9 +1402,9 @@ static void cpufreq_offline(unsigned int cpu)
/* Start governor again for active policy */ /* Start governor again for active policy */
if (!policy_is_inactive(policy)) { if (!policy_is_inactive(policy)) {
if (has_target()) { if (has_target()) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
if (!ret) if (!ret)
ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); ret = cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
if (ret) if (ret)
pr_err("%s: Failed to start governor\n", __func__); pr_err("%s: Failed to start governor\n", __func__);
...@@ -1419,7 +1418,7 @@ static void cpufreq_offline(unsigned int cpu) ...@@ -1419,7 +1418,7 @@ static void cpufreq_offline(unsigned int cpu)
/* If cpu is last user of policy, free policy */ /* If cpu is last user of policy, free policy */
if (has_target()) { if (has_target()) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); ret = cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
if (ret) if (ret)
pr_err("%s: Failed to exit governor\n", __func__); pr_err("%s: Failed to exit governor\n", __func__);
} }
...@@ -1635,7 +1634,7 @@ void cpufreq_suspend(void) ...@@ -1635,7 +1634,7 @@ void cpufreq_suspend(void)
for_each_active_policy(policy) { for_each_active_policy(policy) {
down_write(&policy->rwsem); down_write(&policy->rwsem);
ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
up_write(&policy->rwsem); up_write(&policy->rwsem);
if (ret) if (ret)
...@@ -1678,9 +1677,9 @@ void cpufreq_resume(void) ...@@ -1678,9 +1677,9 @@ void cpufreq_resume(void)
policy); policy);
} else { } else {
down_write(&policy->rwsem); down_write(&policy->rwsem);
ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
if (!ret) if (!ret)
__cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
up_write(&policy->rwsem); up_write(&policy->rwsem);
if (ret) if (ret)
...@@ -1977,8 +1976,7 @@ __weak struct cpufreq_governor *cpufreq_fallback_governor(void) ...@@ -1977,8 +1976,7 @@ __weak struct cpufreq_governor *cpufreq_fallback_governor(void)
return NULL; return NULL;
} }
static int __cpufreq_governor(struct cpufreq_policy *policy, static int cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
unsigned int event)
{ {
int ret; int ret;
...@@ -2190,7 +2188,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, ...@@ -2190,7 +2188,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
old_gov = policy->governor; old_gov = policy->governor;
/* end old governor */ /* end old governor */
if (old_gov) { if (old_gov) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
if (ret) { if (ret) {
/* This can happen due to race with other operations */ /* This can happen due to race with other operations */
pr_debug("%s: Failed to Stop Governor: %s (%d)\n", pr_debug("%s: Failed to Stop Governor: %s (%d)\n",
...@@ -2198,7 +2196,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, ...@@ -2198,7 +2196,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
return ret; return ret;
} }
ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); ret = cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
if (ret) { if (ret) {
pr_err("%s: Failed to Exit Governor: %s (%d)\n", pr_err("%s: Failed to Exit Governor: %s (%d)\n",
__func__, old_gov->name, ret); __func__, old_gov->name, ret);
...@@ -2208,30 +2206,30 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, ...@@ -2208,30 +2206,30 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
/* start new governor */ /* start new governor */
policy->governor = new_policy->governor; policy->governor = new_policy->governor;
ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT); ret = cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT);
if (!ret) { if (!ret) {
ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
if (!ret) if (!ret)
goto out; goto out;
__cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
} }
/* new governor failed, so re-start old one */ /* new governor failed, so re-start old one */
pr_debug("starting governor %s failed\n", policy->governor->name); pr_debug("starting governor %s failed\n", policy->governor->name);
if (old_gov) { if (old_gov) {
policy->governor = old_gov; policy->governor = old_gov;
if (__cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT)) if (cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT))
policy->governor = NULL; policy->governor = NULL;
else else
__cpufreq_governor(policy, CPUFREQ_GOV_START); cpufreq_governor(policy, CPUFREQ_GOV_START);
} }
return ret; return ret;
out: out:
pr_debug("governor: change or update limits\n"); pr_debug("governor: change or update limits\n");
return __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); return cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
} }
/** /**
...@@ -2334,7 +2332,7 @@ static int cpufreq_boost_set_sw(int state) ...@@ -2334,7 +2332,7 @@ static int cpufreq_boost_set_sw(int state)
down_write(&policy->rwsem); down_write(&policy->rwsem);
policy->user_policy.max = policy->max; policy->user_policy.max = policy->max;
__cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
up_write(&policy->rwsem); up_write(&policy->rwsem);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment