aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-02-22 06:06:43 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-03-09 08:41:11 -0500
commita1317e091ab1386812ee8ab4e3bbd89f2811bc74 (patch)
treed152b55c3f3ac7a48b34774ac75ca53f3f255242 /drivers/cpufreq/cpufreq.c
parent11eb69b984aae216ae43c79d2d43441ee68a63ca (diff)
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: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 316beffc960a..b3d05a905034 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -156,8 +156,7 @@ static inline bool has_target(void)
156} 156}
157 157
158/* internal prototypes */ 158/* internal prototypes */
159static int __cpufreq_governor(struct cpufreq_policy *policy, 159static int cpufreq_governor(struct cpufreq_policy *policy, unsigned int event);
160 unsigned int event);
161static unsigned int __cpufreq_get(struct cpufreq_policy *policy); 160static unsigned int __cpufreq_get(struct cpufreq_policy *policy);
162 161
163/** 162/**
@@ -1048,7 +1047,7 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cp
1048 1047
1049 down_write(&policy->rwsem); 1048 down_write(&policy->rwsem);
1050 if (has_target()) { 1049 if (has_target()) {
1051 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); 1050 ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
1052 if (ret) { 1051 if (ret) {
1053 pr_err("%s: Failed to stop governor\n", __func__); 1052 pr_err("%s: Failed to stop governor\n", __func__);
1054 goto unlock; 1053 goto unlock;
@@ -1058,9 +1057,9 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy, unsigned int cp
1058 cpumask_set_cpu(cpu, policy->cpus); 1057 cpumask_set_cpu(cpu, policy->cpus);
1059 1058
1060 if (has_target()) { 1059 if (has_target()) {
1061 ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); 1060 ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
1062 if (!ret) 1061 if (!ret)
1063 ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 1062 ret = cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
1064 1063
1065 if (ret) 1064 if (ret)
1066 pr_err("%s: Failed to start governor\n", __func__); 1065 pr_err("%s: Failed to start governor\n", __func__);
@@ -1382,7 +1381,7 @@ static void cpufreq_offline(unsigned int cpu)
1382 1381
1383 down_write(&policy->rwsem); 1382 down_write(&policy->rwsem);
1384 if (has_target()) { 1383 if (has_target()) {
1385 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); 1384 ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
1386 if (ret) 1385 if (ret)
1387 pr_err("%s: Failed to stop governor\n", __func__); 1386 pr_err("%s: Failed to stop governor\n", __func__);
1388 } 1387 }
@@ -1403,9 +1402,9 @@ static void cpufreq_offline(unsigned int cpu)
1403 /* Start governor again for active policy */ 1402 /* Start governor again for active policy */
1404 if (!policy_is_inactive(policy)) { 1403 if (!policy_is_inactive(policy)) {
1405 if (has_target()) { 1404 if (has_target()) {
1406 ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); 1405 ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
1407 if (!ret) 1406 if (!ret)
1408 ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 1407 ret = cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
1409 1408
1410 if (ret) 1409 if (ret)
1411 pr_err("%s: Failed to start governor\n", __func__); 1410 pr_err("%s: Failed to start governor\n", __func__);
@@ -1419,7 +1418,7 @@ static void cpufreq_offline(unsigned int cpu)
1419 1418
1420 /* If cpu is last user of policy, free policy */ 1419 /* If cpu is last user of policy, free policy */
1421 if (has_target()) { 1420 if (has_target()) {
1422 ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); 1421 ret = cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
1423 if (ret) 1422 if (ret)
1424 pr_err("%s: Failed to exit governor\n", __func__); 1423 pr_err("%s: Failed to exit governor\n", __func__);
1425 } 1424 }
@@ -1635,7 +1634,7 @@ void cpufreq_suspend(void)
1635 1634
1636 for_each_active_policy(policy) { 1635 for_each_active_policy(policy) {
1637 down_write(&policy->rwsem); 1636 down_write(&policy->rwsem);
1638 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); 1637 ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
1639 up_write(&policy->rwsem); 1638 up_write(&policy->rwsem);
1640 1639
1641 if (ret) 1640 if (ret)
@@ -1678,9 +1677,9 @@ void cpufreq_resume(void)
1678 policy); 1677 policy);
1679 } else { 1678 } else {
1680 down_write(&policy->rwsem); 1679 down_write(&policy->rwsem);
1681 ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); 1680 ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
1682 if (!ret) 1681 if (!ret)
1683 __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 1682 cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
1684 up_write(&policy->rwsem); 1683 up_write(&policy->rwsem);
1685 1684
1686 if (ret) 1685 if (ret)
@@ -1977,8 +1976,7 @@ __weak struct cpufreq_governor *cpufreq_fallback_governor(void)
1977 return NULL; 1976 return NULL;
1978} 1977}
1979 1978
1980static int __cpufreq_governor(struct cpufreq_policy *policy, 1979static int cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
1981 unsigned int event)
1982{ 1980{
1983 int ret; 1981 int ret;
1984 1982
@@ -2190,7 +2188,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
2190 old_gov = policy->governor; 2188 old_gov = policy->governor;
2191 /* end old governor */ 2189 /* end old governor */
2192 if (old_gov) { 2190 if (old_gov) {
2193 ret = __cpufreq_governor(policy, CPUFREQ_GOV_STOP); 2191 ret = cpufreq_governor(policy, CPUFREQ_GOV_STOP);
2194 if (ret) { 2192 if (ret) {
2195 /* This can happen due to race with other operations */ 2193 /* This can happen due to race with other operations */
2196 pr_debug("%s: Failed to Stop Governor: %s (%d)\n", 2194 pr_debug("%s: Failed to Stop Governor: %s (%d)\n",
@@ -2198,7 +2196,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
2198 return ret; 2196 return ret;
2199 } 2197 }
2200 2198
2201 ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); 2199 ret = cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
2202 if (ret) { 2200 if (ret) {
2203 pr_err("%s: Failed to Exit Governor: %s (%d)\n", 2201 pr_err("%s: Failed to Exit Governor: %s (%d)\n",
2204 __func__, old_gov->name, ret); 2202 __func__, old_gov->name, ret);
@@ -2208,30 +2206,30 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
2208 2206
2209 /* start new governor */ 2207 /* start new governor */
2210 policy->governor = new_policy->governor; 2208 policy->governor = new_policy->governor;
2211 ret = __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT); 2209 ret = cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT);
2212 if (!ret) { 2210 if (!ret) {
2213 ret = __cpufreq_governor(policy, CPUFREQ_GOV_START); 2211 ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
2214 if (!ret) 2212 if (!ret)
2215 goto out; 2213 goto out;
2216 2214
2217 __cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT); 2215 cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
2218 } 2216 }
2219 2217
2220 /* new governor failed, so re-start old one */ 2218 /* new governor failed, so re-start old one */
2221 pr_debug("starting governor %s failed\n", policy->governor->name); 2219 pr_debug("starting governor %s failed\n", policy->governor->name);
2222 if (old_gov) { 2220 if (old_gov) {
2223 policy->governor = old_gov; 2221 policy->governor = old_gov;
2224 if (__cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT)) 2222 if (cpufreq_governor(policy, CPUFREQ_GOV_POLICY_INIT))
2225 policy->governor = NULL; 2223 policy->governor = NULL;
2226 else 2224 else
2227 __cpufreq_governor(policy, CPUFREQ_GOV_START); 2225 cpufreq_governor(policy, CPUFREQ_GOV_START);
2228 } 2226 }
2229 2227
2230 return ret; 2228 return ret;
2231 2229
2232 out: 2230 out:
2233 pr_debug("governor: change or update limits\n"); 2231 pr_debug("governor: change or update limits\n");
2234 return __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 2232 return cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
2235} 2233}
2236 2234
2237/** 2235/**
@@ -2334,7 +2332,7 @@ static int cpufreq_boost_set_sw(int state)
2334 2332
2335 down_write(&policy->rwsem); 2333 down_write(&policy->rwsem);
2336 policy->user_policy.max = policy->max; 2334 policy->user_policy.max = policy->max;
2337 __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 2335 cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
2338 up_write(&policy->rwsem); 2336 up_write(&policy->rwsem);
2339 } 2337 }
2340 } 2338 }