cpufreq: Unify sysfs attribute definition macros
Multiple modules used to define those which are with identical functionality and were needlessly replicated among the different cpufreq drivers. Push them into the header and remove duplication. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> LKML-Reference: <1270065406-1814-7-git-send-email-bp@amd64.org> Reviewed-by: Thomas Renninger <trenn@suse.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:

committed by
H. Peter Anvin

parent
679370641e
commit
6dad2a2964
@@ -662,32 +662,20 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf)
|
||||
return sprintf(buf, "%u\n", policy->cpuinfo.max_freq);
|
||||
}
|
||||
|
||||
#define define_one_ro(_name) \
|
||||
static struct freq_attr _name = \
|
||||
__ATTR(_name, 0444, show_##_name, NULL)
|
||||
|
||||
#define define_one_ro0400(_name) \
|
||||
static struct freq_attr _name = \
|
||||
__ATTR(_name, 0400, show_##_name, NULL)
|
||||
|
||||
#define define_one_rw(_name) \
|
||||
static struct freq_attr _name = \
|
||||
__ATTR(_name, 0644, show_##_name, store_##_name)
|
||||
|
||||
define_one_ro0400(cpuinfo_cur_freq);
|
||||
define_one_ro(cpuinfo_min_freq);
|
||||
define_one_ro(cpuinfo_max_freq);
|
||||
define_one_ro(cpuinfo_transition_latency);
|
||||
define_one_ro(scaling_available_governors);
|
||||
define_one_ro(scaling_driver);
|
||||
define_one_ro(scaling_cur_freq);
|
||||
define_one_ro(bios_limit);
|
||||
define_one_ro(related_cpus);
|
||||
define_one_ro(affected_cpus);
|
||||
define_one_rw(scaling_min_freq);
|
||||
define_one_rw(scaling_max_freq);
|
||||
define_one_rw(scaling_governor);
|
||||
define_one_rw(scaling_setspeed);
|
||||
cpufreq_freq_attr_ro_perm(cpuinfo_cur_freq, 0400);
|
||||
cpufreq_freq_attr_ro(cpuinfo_min_freq);
|
||||
cpufreq_freq_attr_ro(cpuinfo_max_freq);
|
||||
cpufreq_freq_attr_ro(cpuinfo_transition_latency);
|
||||
cpufreq_freq_attr_ro(scaling_available_governors);
|
||||
cpufreq_freq_attr_ro(scaling_driver);
|
||||
cpufreq_freq_attr_ro(scaling_cur_freq);
|
||||
cpufreq_freq_attr_ro(bios_limit);
|
||||
cpufreq_freq_attr_ro(related_cpus);
|
||||
cpufreq_freq_attr_ro(affected_cpus);
|
||||
cpufreq_freq_attr_rw(scaling_min_freq);
|
||||
cpufreq_freq_attr_rw(scaling_max_freq);
|
||||
cpufreq_freq_attr_rw(scaling_governor);
|
||||
cpufreq_freq_attr_rw(scaling_setspeed);
|
||||
|
||||
static struct attribute *default_attrs[] = {
|
||||
&cpuinfo_min_freq.attr,
|
||||
|
Reference in New Issue
Block a user