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 /include/linux/cpufreq.h | |
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 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 4de02b10007f..9f15150ce8d6 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -278,6 +278,27 @@ struct freq_attr { | |||
278 | ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); | 278 | ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); |
279 | }; | 279 | }; |
280 | 280 | ||
281 | #define cpufreq_freq_attr_ro(_name) \ | ||
282 | static struct freq_attr _name = \ | ||
283 | __ATTR(_name, 0444, show_##_name, NULL) | ||
284 | |||
285 | #define cpufreq_freq_attr_ro_perm(_name, _perm) \ | ||
286 | static struct freq_attr _name = \ | ||
287 | __ATTR(_name, _perm, show_##_name, NULL) | ||
288 | |||
289 | #define cpufreq_freq_attr_ro_old(_name) \ | ||
290 | static struct freq_attr _name##_old = \ | ||
291 | __ATTR(_name, 0444, show_##_name##_old, NULL) | ||
292 | |||
293 | #define cpufreq_freq_attr_rw(_name) \ | ||
294 | static struct freq_attr _name = \ | ||
295 | __ATTR(_name, 0644, show_##_name, store_##_name) | ||
296 | |||
297 | #define cpufreq_freq_attr_rw_old(_name) \ | ||
298 | static struct freq_attr _name##_old = \ | ||
299 | __ATTR(_name, 0644, show_##_name##_old, store_##_name##_old) | ||
300 | |||
301 | |||
281 | struct global_attr { | 302 | struct global_attr { |
282 | struct attribute attr; | 303 | struct attribute attr; |
283 | ssize_t (*show)(struct kobject *kobj, | 304 | ssize_t (*show)(struct kobject *kobj, |
@@ -286,6 +307,15 @@ struct global_attr { | |||
286 | const char *c, size_t count); | 307 | const char *c, size_t count); |
287 | }; | 308 | }; |
288 | 309 | ||
310 | #define define_one_global_ro(_name) \ | ||
311 | static struct global_attr _name = \ | ||
312 | __ATTR(_name, 0444, show_##_name, NULL) | ||
313 | |||
314 | #define define_one_global_rw(_name) \ | ||
315 | static struct global_attr _name = \ | ||
316 | __ATTR(_name, 0644, show_##_name, store_##_name) | ||
317 | |||
318 | |||
289 | /********************************************************************* | 319 | /********************************************************************* |
290 | * CPUFREQ 2.6. INTERFACE * | 320 | * CPUFREQ 2.6. INTERFACE * |
291 | *********************************************************************/ | 321 | *********************************************************************/ |