.gov_check_cpu = cs_check_cpu,
.init = cs_init,
.exit = cs_exit,
- .mutex = __MUTEX_INITIALIZER(cs_dbs_cdata.mutex),
};
static int cs_cpufreq_governor_dbs(struct cpufreq_policy *policy,
#include "cpufreq_governor.h"
+DEFINE_MUTEX(dbs_data_mutex);
+EXPORT_SYMBOL_GPL(dbs_data_mutex);
+
static struct attribute_group *get_sysfs_attr(struct dbs_data *dbs_data)
{
if (have_governor_per_policy())
int ret;
/* Lock governor to block concurrent initialization of governor */
- mutex_lock(&cdata->mutex);
+ mutex_lock(&dbs_data_mutex);
if (have_governor_per_policy())
dbs_data = policy->governor_data;
}
unlock:
- mutex_unlock(&cdata->mutex);
+ mutex_unlock(&dbs_data_mutex);
return ret;
}
/* Governor specific ops, see below */
void *gov_ops;
-
- /*
- * Protects governor's data (struct dbs_data and struct common_dbs_data)
- */
- struct mutex mutex;
};
/* Governor Per policy data */
return sprintf(buf, "%u\n", dbs_data->min_sampling_rate); \
}
+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,
/*
* Lock governor so that governor start/stop can't execute in parallel.
*/
- mutex_lock(&od_dbs_cdata.mutex);
+ mutex_lock(&dbs_data_mutex);
cpumask_copy(&cpumask, cpu_online_mask);
}
}
- mutex_unlock(&od_dbs_cdata.mutex);
+ mutex_unlock(&dbs_data_mutex);
}
static ssize_t store_sampling_rate(struct dbs_data *dbs_data, const char *buf,
.gov_ops = &od_ops,
.init = od_init,
.exit = od_exit,
- .mutex = __MUTEX_INITIALIZER(od_dbs_cdata.mutex),
};
static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy,