diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2009-06-23 23:49:49 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-06-24 01:13:15 -0400 |
commit | 74cad4ee9839669ad920257678ea0bf0a818cd3b (patch) | |
tree | a32e8b4baf67eedb2e9dbc9799c326b92017e1ed /drivers/acpi | |
parent | 07a2039b8eb0af4ff464efd3dfd95de5c02648c6 (diff) |
ACPI: Make ACPI processor proc I/F depend on the ACPI_PROCFS
Now whether the ACPI processor proc I/F is registered depends on the
CONFIG_PROC. It had better depend on the CONFIG_ACPI_PROCFS.
When the CONFIG_ACPI_PROCFS is unset in kernel configuration, the
ACPI processor proc I/F won't be registered.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/Kconfig | 6 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 25 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 8 | ||||
-rw-r--r-- | drivers/acpi/processor_thermal.c | 3 | ||||
-rw-r--r-- | drivers/acpi/processor_throttling.c | 3 |
5 files changed, 36 insertions, 9 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 431f8b439553..f26db487752b 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -60,7 +60,11 @@ config ACPI_PROCFS | |||
60 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) | 60 | /proc/acpi/fadt (/sys/firmware/acpi/tables/FACP) |
61 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) | 61 | /proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer) |
62 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) | 62 | /proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level) |
63 | 63 | /proc/acpi/processor/*/power (/sys/devices/system/cpu/*/cpuidle/*) | |
64 | /proc/acpi/processor/*/performance (/sys/devices/system/cpu/*/ | ||
65 | cpufreq/*) | ||
66 | /proc/acpi/processor/*/throttling (/sys/class/thermal/ | ||
67 | cooling_device*/*) | ||
64 | This option has no effect on /proc/acpi/ files | 68 | This option has no effect on /proc/acpi/ files |
65 | and functions which do not yet exist in /sys. | 69 | and functions which do not yet exist in /sys. |
66 | 70 | ||
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 23f0fb84f1c1..1b166c1be167 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -81,7 +81,9 @@ MODULE_LICENSE("GPL"); | |||
81 | static int acpi_processor_add(struct acpi_device *device); | 81 | static int acpi_processor_add(struct acpi_device *device); |
82 | static int acpi_processor_start(struct acpi_device *device); | 82 | static int acpi_processor_start(struct acpi_device *device); |
83 | static int acpi_processor_remove(struct acpi_device *device, int type); | 83 | static int acpi_processor_remove(struct acpi_device *device, int type); |
84 | #ifdef CONFIG_ACPI_PROCFS | ||
84 | static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); | 85 | static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); |
86 | #endif | ||
85 | static void acpi_processor_notify(struct acpi_device *device, u32 event); | 87 | static void acpi_processor_notify(struct acpi_device *device, u32 event); |
86 | static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); | 88 | static acpi_status acpi_processor_hotadd_init(acpi_handle handle, int *p_cpu); |
87 | static int acpi_processor_handle_eject(struct acpi_processor *pr); | 89 | static int acpi_processor_handle_eject(struct acpi_processor *pr); |
@@ -110,7 +112,7 @@ static struct acpi_driver acpi_processor_driver = { | |||
110 | 112 | ||
111 | #define INSTALL_NOTIFY_HANDLER 1 | 113 | #define INSTALL_NOTIFY_HANDLER 1 |
112 | #define UNINSTALL_NOTIFY_HANDLER 2 | 114 | #define UNINSTALL_NOTIFY_HANDLER 2 |
113 | 115 | #ifdef CONFIG_ACPI_PROCFS | |
114 | static const struct file_operations acpi_processor_info_fops = { | 116 | static const struct file_operations acpi_processor_info_fops = { |
115 | .owner = THIS_MODULE, | 117 | .owner = THIS_MODULE, |
116 | .open = acpi_processor_info_open_fs, | 118 | .open = acpi_processor_info_open_fs, |
@@ -118,6 +120,7 @@ static const struct file_operations acpi_processor_info_fops = { | |||
118 | .llseek = seq_lseek, | 120 | .llseek = seq_lseek, |
119 | .release = single_release, | 121 | .release = single_release, |
120 | }; | 122 | }; |
123 | #endif | ||
121 | 124 | ||
122 | DEFINE_PER_CPU(struct acpi_processor *, processors); | 125 | DEFINE_PER_CPU(struct acpi_processor *, processors); |
123 | struct acpi_processor_errata errata __read_mostly; | 126 | struct acpi_processor_errata errata __read_mostly; |
@@ -316,6 +319,7 @@ static int acpi_processor_set_pdc(struct acpi_processor *pr) | |||
316 | FS Interface (/proc) | 319 | FS Interface (/proc) |
317 | -------------------------------------------------------------------------- */ | 320 | -------------------------------------------------------------------------- */ |
318 | 321 | ||
322 | #ifdef CONFIG_ACPI_PROCFS | ||
319 | static struct proc_dir_entry *acpi_processor_dir = NULL; | 323 | static struct proc_dir_entry *acpi_processor_dir = NULL; |
320 | 324 | ||
321 | static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) | 325 | static int acpi_processor_info_seq_show(struct seq_file *seq, void *offset) |
@@ -388,7 +392,6 @@ static int acpi_processor_add_fs(struct acpi_device *device) | |||
388 | return -EIO; | 392 | return -EIO; |
389 | return 0; | 393 | return 0; |
390 | } | 394 | } |
391 | |||
392 | static int acpi_processor_remove_fs(struct acpi_device *device) | 395 | static int acpi_processor_remove_fs(struct acpi_device *device) |
393 | { | 396 | { |
394 | 397 | ||
@@ -405,6 +408,16 @@ static int acpi_processor_remove_fs(struct acpi_device *device) | |||
405 | 408 | ||
406 | return 0; | 409 | return 0; |
407 | } | 410 | } |
411 | #else | ||
412 | static inline int acpi_processor_add_fs(struct acpi_device *device) | ||
413 | { | ||
414 | return 0; | ||
415 | } | ||
416 | static inline int acpi_processor_remove_fs(struct acpi_device *device) | ||
417 | { | ||
418 | return 0; | ||
419 | } | ||
420 | #endif | ||
408 | 421 | ||
409 | /* Use the acpiid in MADT to map cpus in case of SMP */ | 422 | /* Use the acpiid in MADT to map cpus in case of SMP */ |
410 | 423 | ||
@@ -1147,11 +1160,11 @@ static int __init acpi_processor_init(void) | |||
1147 | (struct acpi_table_header **)&madt))) | 1160 | (struct acpi_table_header **)&madt))) |
1148 | madt = NULL; | 1161 | madt = NULL; |
1149 | #endif | 1162 | #endif |
1150 | 1163 | #ifdef CONFIG_ACPI_PROCFS | |
1151 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1164 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
1152 | if (!acpi_processor_dir) | 1165 | if (!acpi_processor_dir) |
1153 | return -ENOMEM; | 1166 | return -ENOMEM; |
1154 | 1167 | #endif | |
1155 | /* | 1168 | /* |
1156 | * Check whether the system is DMI table. If yes, OSPM | 1169 | * Check whether the system is DMI table. If yes, OSPM |
1157 | * should not use mwait for CPU-states. | 1170 | * should not use mwait for CPU-states. |
@@ -1179,7 +1192,9 @@ out_cpuidle: | |||
1179 | cpuidle_unregister_driver(&acpi_idle_driver); | 1192 | cpuidle_unregister_driver(&acpi_idle_driver); |
1180 | 1193 | ||
1181 | out_proc: | 1194 | out_proc: |
1195 | #ifdef CONFIG_ACPI_PROCFS | ||
1182 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1196 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
1197 | #endif | ||
1183 | 1198 | ||
1184 | return result; | 1199 | return result; |
1185 | } | 1200 | } |
@@ -1196,7 +1211,9 @@ static void __exit acpi_processor_exit(void) | |||
1196 | 1211 | ||
1197 | cpuidle_unregister_driver(&acpi_idle_driver); | 1212 | cpuidle_unregister_driver(&acpi_idle_driver); |
1198 | 1213 | ||
1214 | #ifdef CONFIG_ACPI_PROCFS | ||
1199 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | 1215 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); |
1216 | #endif | ||
1200 | 1217 | ||
1201 | return; | 1218 | return; |
1202 | } | 1219 | } |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 10a2d913635a..67b2fa1b5b63 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -679,6 +679,7 @@ static int acpi_processor_get_power_info(struct acpi_processor *pr) | |||
679 | return 0; | 679 | return 0; |
680 | } | 680 | } |
681 | 681 | ||
682 | #ifdef CONFIG_ACPI_PROCFS | ||
682 | static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | 683 | static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) |
683 | { | 684 | { |
684 | struct acpi_processor *pr = seq->private; | 685 | struct acpi_processor *pr = seq->private; |
@@ -758,7 +759,7 @@ static const struct file_operations acpi_processor_power_fops = { | |||
758 | .llseek = seq_lseek, | 759 | .llseek = seq_lseek, |
759 | .release = single_release, | 760 | .release = single_release, |
760 | }; | 761 | }; |
761 | 762 | #endif | |
762 | 763 | ||
763 | /** | 764 | /** |
764 | * acpi_idle_bm_check - checks if bus master activity was detected | 765 | * acpi_idle_bm_check - checks if bus master activity was detected |
@@ -1216,7 +1217,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1216 | pr->power.states[i].type); | 1217 | pr->power.states[i].type); |
1217 | printk(")\n"); | 1218 | printk(")\n"); |
1218 | } | 1219 | } |
1219 | 1220 | #ifdef CONFIG_ACPI_PROCFS | |
1220 | /* 'power' [R] */ | 1221 | /* 'power' [R] */ |
1221 | entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER, | 1222 | entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER, |
1222 | S_IRUGO, acpi_device_dir(device), | 1223 | S_IRUGO, acpi_device_dir(device), |
@@ -1224,6 +1225,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr, | |||
1224 | acpi_driver_data(device)); | 1225 | acpi_driver_data(device)); |
1225 | if (!entry) | 1226 | if (!entry) |
1226 | return -EIO; | 1227 | return -EIO; |
1228 | #endif | ||
1227 | return 0; | 1229 | return 0; |
1228 | } | 1230 | } |
1229 | 1231 | ||
@@ -1236,9 +1238,11 @@ int acpi_processor_power_exit(struct acpi_processor *pr, | |||
1236 | cpuidle_unregister_device(&pr->power.dev); | 1238 | cpuidle_unregister_device(&pr->power.dev); |
1237 | pr->flags.power_setup_done = 0; | 1239 | pr->flags.power_setup_done = 0; |
1238 | 1240 | ||
1241 | #ifdef CONFIG_ACPI_PROCFS | ||
1239 | if (acpi_device_dir(device)) | 1242 | if (acpi_device_dir(device)) |
1240 | remove_proc_entry(ACPI_PROCESSOR_FILE_POWER, | 1243 | remove_proc_entry(ACPI_PROCESSOR_FILE_POWER, |
1241 | acpi_device_dir(device)); | 1244 | acpi_device_dir(device)); |
1245 | #endif | ||
1242 | 1246 | ||
1243 | return 0; | 1247 | return 0; |
1244 | } | 1248 | } |
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 39838c666032..07e26140e977 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -438,7 +438,7 @@ struct thermal_cooling_device_ops processor_cooling_ops = { | |||
438 | }; | 438 | }; |
439 | 439 | ||
440 | /* /proc interface */ | 440 | /* /proc interface */ |
441 | 441 | #ifdef CONFIG_ACPI_PROCFS | |
442 | static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) | 442 | static int acpi_processor_limit_seq_show(struct seq_file *seq, void *offset) |
443 | { | 443 | { |
444 | struct acpi_processor *pr = (struct acpi_processor *)seq->private; | 444 | struct acpi_processor *pr = (struct acpi_processor *)seq->private; |
@@ -517,3 +517,4 @@ const struct file_operations acpi_processor_limit_fops = { | |||
517 | .llseek = seq_lseek, | 517 | .llseek = seq_lseek, |
518 | .release = single_release, | 518 | .release = single_release, |
519 | }; | 519 | }; |
520 | #endif | ||
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index 227543789ba9..16560014f7bd 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
@@ -1214,7 +1214,7 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) | |||
1214 | } | 1214 | } |
1215 | 1215 | ||
1216 | /* proc interface */ | 1216 | /* proc interface */ |
1217 | 1217 | #ifdef CONFIG_ACPI_PROCFS | |
1218 | static int acpi_processor_throttling_seq_show(struct seq_file *seq, | 1218 | static int acpi_processor_throttling_seq_show(struct seq_file *seq, |
1219 | void *offset) | 1219 | void *offset) |
1220 | { | 1220 | { |
@@ -1322,3 +1322,4 @@ const struct file_operations acpi_processor_throttling_fops = { | |||
1322 | .llseek = seq_lseek, | 1322 | .llseek = seq_lseek, |
1323 | .release = single_release, | 1323 | .release = single_release, |
1324 | }; | 1324 | }; |
1325 | #endif | ||