define_get_cpu_dbs_routines(cs_cpu_dbs_info);
-static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
- unsigned int event);
-
static struct dbs_governor cs_dbs_gov = {
.gov = {
.name = "conservative",
- .governor = cs_cpufreq_governor_dbs,
+ .governor = cpufreq_governor_dbs,
.max_transition_latency = TRANSITION_LATENCY_LIMIT,
.owner = THIS_MODULE,
},
#define CPU_FREQ_GOV_CONSERVATIVE (&cs_dbs_gov.gov)
-static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
- unsigned int event)
-{
- return cpufreq_governor_dbs(policy, &cs_dbs_gov, event);
-}
-
static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
void *data)
{
kfree(shared);
}
-static int cpufreq_governor_init(struct cpufreq_policy *policy,
- struct dbs_governor *gov)
+static int cpufreq_governor_init(struct cpufreq_policy *policy)
{
+ struct dbs_governor *gov = container_of(policy->governor,
+ struct dbs_governor, gov);
struct dbs_data *dbs_data = gov->gdbs_data;
unsigned int latency;
int ret;
return 0;
}
-int cpufreq_governor_dbs(struct cpufreq_policy *policy,
- struct dbs_governor *gov, unsigned int event)
+int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event)
{
int ret = -EINVAL;
mutex_lock(&dbs_data_mutex);
if (event == CPUFREQ_GOV_POLICY_INIT) {
- ret = cpufreq_governor_init(policy, gov);
+ ret = cpufreq_governor_init(policy);
} else if (policy->governor_data) {
switch (event) {
case CPUFREQ_GOV_POLICY_EXIT:
extern struct mutex dbs_data_mutex;
extern struct mutex cpufreq_governor_lock;
void dbs_check_cpu(struct dbs_data *dbs_data, int cpu);
-int cpufreq_governor_dbs(struct cpufreq_policy *policy,
- struct dbs_governor *gov, unsigned int event);
+int cpufreq_governor_dbs(struct cpufreq_policy *policy, unsigned int event);
void od_register_powersave_bias_handler(unsigned int (*f)
(struct cpufreq_policy *, unsigned int, unsigned int),
unsigned int powersave_bias);
.freq_increase = dbs_freq_increase,
};
-static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy,
- unsigned int event);
-
static struct dbs_governor od_dbs_gov = {
.gov = {
.name = "ondemand",
- .governor = od_cpufreq_governor_dbs,
+ .governor = cpufreq_governor_dbs,
.max_transition_latency = TRANSITION_LATENCY_LIMIT,
.owner = THIS_MODULE,
},
#define CPU_FREQ_GOV_ONDEMAND (&od_dbs_gov.gov)
-static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy,
- unsigned int event)
-{
- return cpufreq_governor_dbs(policy, &od_dbs_gov, event);
-}
-
static void od_set_powersave_bias(unsigned int powersave_bias)
{
struct cpufreq_policy *policy;