diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2010-03-31 15:56:46 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-04-09 17:07:56 -0400 |
commit | 6dad2a29646ce3792c40cfc52d77e9b65a7bb143 (patch) | |
tree | 85fce9bcdffe83c2b1f6487bf286f910ef7aba4d /drivers/cpufreq/cpufreq.c | |
parent | 679370641e3675633cad222449262abbe93a4a2a (diff) |
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>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 2d5d575e889d..e02e4174c2c8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -662,32 +662,20 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf) | |||
662 | return sprintf(buf, "%u\n", policy->cpuinfo.max_freq); | 662 | return sprintf(buf, "%u\n", policy->cpuinfo.max_freq); |
663 | } | 663 | } |
664 | 664 | ||
665 | #define define_one_ro(_name) \ | 665 | cpufreq_freq_attr_ro_perm(cpuinfo_cur_freq, 0400); |
666 | static struct freq_attr _name = \ | 666 | cpufreq_freq_attr_ro(cpuinfo_min_freq); |
667 | __ATTR(_name, 0444, show_##_name, NULL) | 667 | cpufreq_freq_attr_ro(cpuinfo_max_freq); |
668 | 668 | cpufreq_freq_attr_ro(cpuinfo_transition_latency); | |
669 | #define define_one_ro0400(_name) \ | 669 | cpufreq_freq_attr_ro(scaling_available_governors); |
670 | static struct freq_attr _name = \ | 670 | cpufreq_freq_attr_ro(scaling_driver); |
671 | __ATTR(_name, 0400, show_##_name, NULL) | 671 | cpufreq_freq_attr_ro(scaling_cur_freq); |
672 | 672 | cpufreq_freq_attr_ro(bios_limit); | |
673 | #define define_one_rw(_name) \ | 673 | cpufreq_freq_attr_ro(related_cpus); |
674 | static struct freq_attr _name = \ | 674 | cpufreq_freq_attr_ro(affected_cpus); |
675 | __ATTR(_name, 0644, show_##_name, store_##_name) | 675 | cpufreq_freq_attr_rw(scaling_min_freq); |
676 | 676 | cpufreq_freq_attr_rw(scaling_max_freq); | |
677 | define_one_ro0400(cpuinfo_cur_freq); | 677 | cpufreq_freq_attr_rw(scaling_governor); |
678 | define_one_ro(cpuinfo_min_freq); | 678 | cpufreq_freq_attr_rw(scaling_setspeed); |
679 | define_one_ro(cpuinfo_max_freq); | ||
680 | define_one_ro(cpuinfo_transition_latency); | ||
681 | define_one_ro(scaling_available_governors); | ||
682 | define_one_ro(scaling_driver); | ||
683 | define_one_ro(scaling_cur_freq); | ||
684 | define_one_ro(bios_limit); | ||
685 | define_one_ro(related_cpus); | ||
686 | define_one_ro(affected_cpus); | ||
687 | define_one_rw(scaling_min_freq); | ||
688 | define_one_rw(scaling_max_freq); | ||
689 | define_one_rw(scaling_governor); | ||
690 | define_one_rw(scaling_setspeed); | ||
691 | 679 | ||
692 | static struct attribute *default_attrs[] = { | 680 | static struct attribute *default_attrs[] = { |
693 | &cpuinfo_min_freq.attr, | 681 | &cpuinfo_min_freq.attr, |