aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2010-10-08 01:55:15 -0400
committerLen Brown <len.brown@intel.com>2010-10-15 22:03:17 -0400
commitd5c6887c7fbaf7a149c3bf441338fa833c529fb4 (patch)
treee112c1904cb23d20b87ffe66e075f3635e4a5ce1 /drivers
parent39fe394d05be43481ceac8b3db19dfd5189097f6 (diff)
ACPI processor: make /proc/acpi/processor/*/throttle depends on CONFIG_ACPI_PROCFS
As a feature that would only be used when system is overheating, the processor t-state control should not be exported to user space. Make /proc/acpi/processor/*/throttle depends on CONFIG_ACPI_PROCFS, which is cleared by default. And we will remove this I/F in 2.6.38. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/processor_driver.c20
-rw-r--r--drivers/acpi/processor_throttling.c4
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 347eb21b2353..356c320bdd08 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -40,8 +40,10 @@
40#include <linux/pm.h> 40#include <linux/pm.h>
41#include <linux/cpufreq.h> 41#include <linux/cpufreq.h>
42#include <linux/cpu.h> 42#include <linux/cpu.h>
43#ifdef CONFIG_ACPI_PROCFS
43#include <linux/proc_fs.h> 44#include <linux/proc_fs.h>
44#include <linux/seq_file.h> 45#include <linux/seq_file.h>
46#endif
45#include <linux/dmi.h> 47#include <linux/dmi.h>
46#include <linux/moduleparam.h> 48#include <linux/moduleparam.h>
47#include <linux/cpuidle.h> 49#include <linux/cpuidle.h>
@@ -244,6 +246,7 @@ static int acpi_processor_errata(struct acpi_processor *pr)
244 return result; 246 return result;
245} 247}
246 248
249#ifdef CONFIG_ACPI_PROCFS
247static struct proc_dir_entry *acpi_processor_dir = NULL; 250static struct proc_dir_entry *acpi_processor_dir = NULL;
248 251
249static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) 252static int __cpuinit acpi_processor_add_fs(struct acpi_device *device)
@@ -280,7 +283,16 @@ static int acpi_processor_remove_fs(struct acpi_device *device)
280 283
281 return 0; 284 return 0;
282} 285}
283 286#else
287static inline int acpi_processor_add_fs(struct acpi_device *device)
288{
289 return 0;
290}
291static inline int acpi_processor_remove_fs(struct acpi_device *device)
292{
293 return 0;
294}
295#endif
284/* -------------------------------------------------------------------------- 296/* --------------------------------------------------------------------------
285 Driver Interface 297 Driver Interface
286 -------------------------------------------------------------------------- */ 298 -------------------------------------------------------------------------- */
@@ -842,9 +854,11 @@ static int __init acpi_processor_init(void)
842 854
843 memset(&errata, 0, sizeof(errata)); 855 memset(&errata, 0, sizeof(errata));
844 856
857#ifdef CONFIG_ACPI_PROCFS
845 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); 858 acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir);
846 if (!acpi_processor_dir) 859 if (!acpi_processor_dir)
847 return -ENOMEM; 860 return -ENOMEM;
861#endif
848 862
849 if (!cpuidle_register_driver(&acpi_idle_driver)) { 863 if (!cpuidle_register_driver(&acpi_idle_driver)) {
850 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", 864 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
@@ -871,7 +885,9 @@ static int __init acpi_processor_init(void)
871out_cpuidle: 885out_cpuidle:
872 cpuidle_unregister_driver(&acpi_idle_driver); 886 cpuidle_unregister_driver(&acpi_idle_driver);
873 887
888#ifdef CONFIG_ACPI_PROCFS
874 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 889 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
890#endif
875 891
876 return result; 892 return result;
877} 893}
@@ -891,7 +907,9 @@ static void __exit acpi_processor_exit(void)
891 907
892 cpuidle_unregister_driver(&acpi_idle_driver); 908 cpuidle_unregister_driver(&acpi_idle_driver);
893 909
910#ifdef CONFIG_ACPI_PROCFS
894 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 911 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
912#endif
895 913
896 return; 914 return;
897} 915}
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 730863855ed5..ff3632717c51 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -32,8 +32,10 @@
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/sched.h> 33#include <linux/sched.h>
34#include <linux/cpufreq.h> 34#include <linux/cpufreq.h>
35#ifdef CONFIG_ACPI_PROCFS
35#include <linux/proc_fs.h> 36#include <linux/proc_fs.h>
36#include <linux/seq_file.h> 37#include <linux/seq_file.h>
38#endif
37 39
38#include <asm/io.h> 40#include <asm/io.h>
39#include <asm/uaccess.h> 41#include <asm/uaccess.h>
@@ -1214,6 +1216,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
1214 return result; 1216 return result;
1215} 1217}
1216 1218
1219#ifdef CONFIG_ACPI_PROCFS
1217/* proc interface */ 1220/* proc interface */
1218static int acpi_processor_throttling_seq_show(struct seq_file *seq, 1221static int acpi_processor_throttling_seq_show(struct seq_file *seq,
1219 void *offset) 1222 void *offset)
@@ -1322,3 +1325,4 @@ const struct file_operations acpi_processor_throttling_fops = {
1322 .llseek = seq_lseek, 1325 .llseek = seq_lseek,
1323 .release = single_release, 1326 .release = single_release,
1324}; 1327};
1328#endif