Commit 7bdad34d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: governor: Rename some data types and variables

The ondemand and conservative governors are represented by
struct common_dbs_data whose name doesn't reflect the purpose it
is used for, so rename it to struct dbs_governor and rename
variables of that type accordingly.

No functional changes.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent af926185
...@@ -48,7 +48,7 @@ static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy, ...@@ -48,7 +48,7 @@ static unsigned int amd_powersave_bias_target(struct cpufreq_policy *policy,
struct dbs_data *od_data = policy->governor_data; struct dbs_data *od_data = policy->governor_data;
struct od_dbs_tuners *od_tuners = od_data->tuners; struct od_dbs_tuners *od_tuners = od_data->tuners;
struct od_cpu_dbs_info_s *od_info = struct od_cpu_dbs_info_s *od_info =
od_data->cdata->get_cpu_dbs_info_s(policy->cpu); od_data->gov->get_cpu_dbs_info_s(policy->cpu);
if (!od_info->freq_table) if (!od_info->freq_table)
return freq_next; return freq_next;
......
...@@ -119,7 +119,7 @@ static struct notifier_block cs_cpufreq_notifier_block = { ...@@ -119,7 +119,7 @@ static struct notifier_block cs_cpufreq_notifier_block = {
}; };
/************************** sysfs interface ************************/ /************************** sysfs interface ************************/
static struct common_dbs_data cs_dbs_cdata; static struct dbs_governor cs_dbs_gov;
static ssize_t store_sampling_down_factor(struct dbs_data *dbs_data, static ssize_t store_sampling_down_factor(struct dbs_data *dbs_data,
const char *buf, size_t count) const char *buf, size_t count)
...@@ -328,7 +328,7 @@ define_get_cpu_dbs_routines(cs_cpu_dbs_info); ...@@ -328,7 +328,7 @@ define_get_cpu_dbs_routines(cs_cpu_dbs_info);
static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy, static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
unsigned int event); unsigned int event);
static struct common_dbs_data cs_dbs_cdata = { static struct dbs_governor cs_dbs_gov = {
.gov = { .gov = {
.name = "conservative", .name = "conservative",
.governor = cs_cpufreq_governor_dbs, .governor = cs_cpufreq_governor_dbs,
...@@ -346,12 +346,12 @@ static struct common_dbs_data cs_dbs_cdata = { ...@@ -346,12 +346,12 @@ static struct common_dbs_data cs_dbs_cdata = {
.exit = cs_exit, .exit = cs_exit,
}; };
#define CPU_FREQ_GOV_CONSERVATIVE (&cs_dbs_cdata.gov) #define CPU_FREQ_GOV_CONSERVATIVE (&cs_dbs_gov.gov)
static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy, static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
unsigned int event) unsigned int event)
{ {
return cpufreq_governor_dbs(policy, &cs_dbs_cdata, event); return cpufreq_governor_dbs(policy, &cs_dbs_gov, event);
} }
static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
......
This diff is collapsed.
...@@ -78,7 +78,7 @@ __ATTR(_name, 0644, show_##_name##_gov_pol, store_##_name##_gov_pol) ...@@ -78,7 +78,7 @@ __ATTR(_name, 0644, show_##_name##_gov_pol, store_##_name##_gov_pol)
static ssize_t show_##file_name##_gov_sys \ static ssize_t show_##file_name##_gov_sys \
(struct kobject *kobj, struct attribute *attr, char *buf) \ (struct kobject *kobj, struct attribute *attr, char *buf) \
{ \ { \
struct _gov##_dbs_tuners *tuners = _gov##_dbs_cdata.gdbs_data->tuners; \ struct _gov##_dbs_tuners *tuners = _gov##_dbs_gov.gdbs_data->tuners; \
return sprintf(buf, "%u\n", tuners->file_name); \ return sprintf(buf, "%u\n", tuners->file_name); \
} \ } \
\ \
...@@ -94,7 +94,7 @@ static ssize_t show_##file_name##_gov_pol \ ...@@ -94,7 +94,7 @@ static ssize_t show_##file_name##_gov_pol \
static ssize_t store_##file_name##_gov_sys \ static ssize_t store_##file_name##_gov_sys \
(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) \ (struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) \
{ \ { \
struct dbs_data *dbs_data = _gov##_dbs_cdata.gdbs_data; \ struct dbs_data *dbs_data = _gov##_dbs_gov.gdbs_data; \
return store_##file_name(dbs_data, buf, count); \ return store_##file_name(dbs_data, buf, count); \
} \ } \
\ \
...@@ -205,7 +205,7 @@ struct cs_dbs_tuners { ...@@ -205,7 +205,7 @@ struct cs_dbs_tuners {
/* Common Governor data across policies */ /* Common Governor data across policies */
struct dbs_data; struct dbs_data;
struct common_dbs_data { struct dbs_governor {
struct cpufreq_governor gov; struct cpufreq_governor gov;
#define GOV_ONDEMAND 0 #define GOV_ONDEMAND 0
...@@ -233,7 +233,7 @@ struct common_dbs_data { ...@@ -233,7 +233,7 @@ struct common_dbs_data {
/* Governor Per policy data */ /* Governor Per policy data */
struct dbs_data { struct dbs_data {
struct common_dbs_data *cdata; struct dbs_governor *gov;
unsigned int min_sampling_rate; unsigned int min_sampling_rate;
int usage_count; int usage_count;
void *tuners; void *tuners;
...@@ -262,7 +262,7 @@ static inline int delay_for_sampling_rate(unsigned int sampling_rate) ...@@ -262,7 +262,7 @@ static inline int delay_for_sampling_rate(unsigned int sampling_rate)
static ssize_t show_sampling_rate_min_gov_sys \ static ssize_t show_sampling_rate_min_gov_sys \
(struct kobject *kobj, struct attribute *attr, char *buf) \ (struct kobject *kobj, struct attribute *attr, char *buf) \
{ \ { \
struct dbs_data *dbs_data = _gov##_dbs_cdata.gdbs_data; \ struct dbs_data *dbs_data = _gov##_dbs_gov.gdbs_data; \
return sprintf(buf, "%u\n", dbs_data->min_sampling_rate); \ return sprintf(buf, "%u\n", dbs_data->min_sampling_rate); \
} \ } \
\ \
...@@ -277,7 +277,7 @@ extern struct mutex dbs_data_mutex; ...@@ -277,7 +277,7 @@ extern struct mutex dbs_data_mutex;
extern struct mutex cpufreq_governor_lock; extern struct mutex cpufreq_governor_lock;
void dbs_check_cpu(struct dbs_data *dbs_data, int cpu); void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
int cpufreq_governor_dbs(struct cpufreq_policy *policy, int cpufreq_governor_dbs(struct cpufreq_policy *policy,
struct common_dbs_data *cdata, unsigned int event); struct dbs_governor *gov, unsigned int event);
void od_register_powersave_bias_handler(unsigned int (*f) void od_register_powersave_bias_handler(unsigned int (*f)
(struct cpufreq_policy *, unsigned int, unsigned int), (struct cpufreq_policy *, unsigned int, unsigned int),
unsigned int powersave_bias); unsigned int powersave_bias);
......
...@@ -219,7 +219,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy) ...@@ -219,7 +219,7 @@ static unsigned int od_dbs_timer(struct cpufreq_policy *policy)
} }
/************************** sysfs interface ************************/ /************************** sysfs interface ************************/
static struct common_dbs_data od_dbs_cdata; static struct dbs_governor od_dbs_gov;
/** /**
* update_sampling_rate - update sampling rate effective immediately if needed. * update_sampling_rate - update sampling rate effective immediately if needed.
...@@ -542,7 +542,7 @@ static struct od_ops od_ops = { ...@@ -542,7 +542,7 @@ static struct od_ops od_ops = {
static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy, static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy,
unsigned int event); unsigned int event);
static struct common_dbs_data od_dbs_cdata = { static struct dbs_governor od_dbs_gov = {
.gov = { .gov = {
.name = "ondemand", .name = "ondemand",
.governor = od_cpufreq_governor_dbs, .governor = od_cpufreq_governor_dbs,
...@@ -561,12 +561,12 @@ static struct common_dbs_data od_dbs_cdata = { ...@@ -561,12 +561,12 @@ static struct common_dbs_data od_dbs_cdata = {
.exit = od_exit, .exit = od_exit,
}; };
#define CPU_FREQ_GOV_ONDEMAND (&od_dbs_cdata.gov) #define CPU_FREQ_GOV_ONDEMAND (&od_dbs_gov.gov)
static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy, static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy,
unsigned int event) unsigned int event)
{ {
return cpufreq_governor_dbs(policy, &od_dbs_cdata, event); return cpufreq_governor_dbs(policy, &od_dbs_gov, event);
} }
static void od_set_powersave_bias(unsigned int powersave_bias) static void od_set_powersave_bias(unsigned int powersave_bias)
......
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