diff options
author | Len Brown <len.brown@intel.com> | 2011-01-12 05:00:07 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 05:00:07 -0500 |
commit | c1b2dab96f3c1cb051b85d82d7e70e12e9b930f2 (patch) | |
tree | 9ef312cd3b4ce583364923ad708168add6059285 | |
parent | 6d1f23f204c9e4638bd30ff3a768c47e40cd3ac0 (diff) | |
parent | 6d855fcdd24d2491455527c4999b4d04363f1980 (diff) |
Merge branch 'procfs-cleanup' into release
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 11 | ||||
-rw-r--r-- | drivers/acpi/Kconfig | 6 | ||||
-rw-r--r-- | drivers/acpi/ac.c | 3 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 2 | ||||
-rw-r--r-- | drivers/acpi/processor_driver.c | 75 | ||||
-rw-r--r-- | drivers/acpi/processor_throttling.c | 114 | ||||
-rw-r--r-- | drivers/acpi/sbs.c | 2 |
7 files changed, 20 insertions, 193 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 6c2f55e05f13..f281532a15ce 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -232,6 +232,17 @@ Who: Zhang Rui <rui.zhang@intel.com> | |||
232 | 232 | ||
233 | --------------------------- | 233 | --------------------------- |
234 | 234 | ||
235 | What: CONFIG_ACPI_PROCFS_POWER | ||
236 | When: 2.6.39 | ||
237 | Why: sysfs I/F for ACPI power devices, including AC and Battery, | ||
238 | has been working in upstream kenrel since 2.6.24, Sep 2007. | ||
239 | In 2.6.37, we make the sysfs I/F always built in and this option | ||
240 | disabled by default. | ||
241 | Remove this option and the ACPI power procfs interface in 2.6.39. | ||
242 | Who: Zhang Rui <rui.zhang@intel.com> | ||
243 | |||
244 | --------------------------- | ||
245 | |||
235 | What: /proc/acpi/button | 246 | What: /proc/acpi/button |
236 | When: August 2007 | 247 | When: August 2007 |
237 | Why: /proc/acpi/button has been replaced by events to the input layer | 248 | Why: /proc/acpi/button has been replaced by events to the input layer |
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 3f3489c5ca8c..788e88eb18ec 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
@@ -53,10 +53,6 @@ config ACPI_PROCFS | |||
53 | they have been replaced by functions in /sys. | 53 | they have been replaced by functions in /sys. |
54 | The deprecated files (and their replacements) include: | 54 | The deprecated files (and their replacements) include: |
55 | 55 | ||
56 | /proc/acpi/processor/*/throttling (/sys/class/thermal/ | ||
57 | cooling_device*/*) | ||
58 | /proc/acpi/video/*/brightness (/sys/class/backlight/) | ||
59 | /proc/acpi/thermal_zone/*/* (/sys/class/thermal/) | ||
60 | This option has no effect on /proc/acpi/ files | 56 | This option has no effect on /proc/acpi/ files |
61 | and functions which do not yet exist in /sys. | 57 | and functions which do not yet exist in /sys. |
62 | 58 | ||
@@ -74,6 +70,8 @@ config ACPI_PROCFS_POWER | |||
74 | /proc/acpi/ac_adapter/* (sys/class/power_supply/*) | 70 | /proc/acpi/ac_adapter/* (sys/class/power_supply/*) |
75 | This option has no effect on /proc/acpi/ directories | 71 | This option has no effect on /proc/acpi/ directories |
76 | and functions, which do not yet exist in /sys | 72 | and functions, which do not yet exist in /sys |
73 | This option, together with the proc directories, will be | ||
74 | deleted in 2.6.39. | ||
77 | 75 | ||
78 | Say N to delete power /proc/acpi/ directories that have moved to /sys/ | 76 | Say N to delete power /proc/acpi/ directories that have moved to /sys/ |
79 | 77 | ||
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 25d3aaebc10d..58c3f74bd84c 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -197,7 +197,8 @@ static int acpi_ac_add_fs(struct acpi_device *device) | |||
197 | { | 197 | { |
198 | struct proc_dir_entry *entry = NULL; | 198 | struct proc_dir_entry *entry = NULL; |
199 | 199 | ||
200 | 200 | printk(KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded," | |
201 | " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n"); | ||
201 | if (!acpi_device_dir(device)) { | 202 | if (!acpi_device_dir(device)) { |
202 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | 203 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), |
203 | acpi_ac_dir); | 204 | acpi_ac_dir); |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 95649d373071..2a31421e0d75 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -868,6 +868,8 @@ static int acpi_battery_add_fs(struct acpi_device *device) | |||
868 | struct proc_dir_entry *entry = NULL; | 868 | struct proc_dir_entry *entry = NULL; |
869 | int i; | 869 | int i; |
870 | 870 | ||
871 | printk(KERN_WARNING PREFIX "Deprecated procfs I/F for battery is loaded," | ||
872 | " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n"); | ||
871 | if (!acpi_device_dir(device)) { | 873 | if (!acpi_device_dir(device)) { |
872 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | 874 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), |
873 | acpi_battery_dir); | 875 | acpi_battery_dir); |
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 85e48047d7b0..29572debc65d 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -40,10 +40,6 @@ | |||
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 | ||
44 | #include <linux/proc_fs.h> | ||
45 | #include <linux/seq_file.h> | ||
46 | #endif | ||
47 | #include <linux/dmi.h> | 43 | #include <linux/dmi.h> |
48 | #include <linux/moduleparam.h> | 44 | #include <linux/moduleparam.h> |
49 | #include <linux/cpuidle.h> | 45 | #include <linux/cpuidle.h> |
@@ -246,53 +242,6 @@ static int acpi_processor_errata(struct acpi_processor *pr) | |||
246 | return result; | 242 | return result; |
247 | } | 243 | } |
248 | 244 | ||
249 | #ifdef CONFIG_ACPI_PROCFS | ||
250 | static struct proc_dir_entry *acpi_processor_dir = NULL; | ||
251 | |||
252 | static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) | ||
253 | { | ||
254 | struct proc_dir_entry *entry = NULL; | ||
255 | |||
256 | |||
257 | if (!acpi_device_dir(device)) { | ||
258 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | ||
259 | acpi_processor_dir); | ||
260 | if (!acpi_device_dir(device)) | ||
261 | return -ENODEV; | ||
262 | } | ||
263 | |||
264 | /* 'throttling' [R/W] */ | ||
265 | entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING, | ||
266 | S_IFREG | S_IRUGO | S_IWUSR, | ||
267 | acpi_device_dir(device), | ||
268 | &acpi_processor_throttling_fops, | ||
269 | acpi_driver_data(device)); | ||
270 | if (!entry) | ||
271 | return -EIO; | ||
272 | return 0; | ||
273 | } | ||
274 | static int acpi_processor_remove_fs(struct acpi_device *device) | ||
275 | { | ||
276 | |||
277 | if (acpi_device_dir(device)) { | ||
278 | remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, | ||
279 | acpi_device_dir(device)); | ||
280 | remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); | ||
281 | acpi_device_dir(device) = NULL; | ||
282 | } | ||
283 | |||
284 | return 0; | ||
285 | } | ||
286 | #else | ||
287 | static inline int acpi_processor_add_fs(struct acpi_device *device) | ||
288 | { | ||
289 | return 0; | ||
290 | } | ||
291 | static inline int acpi_processor_remove_fs(struct acpi_device *device) | ||
292 | { | ||
293 | return 0; | ||
294 | } | ||
295 | #endif | ||
296 | /* -------------------------------------------------------------------------- | 245 | /* -------------------------------------------------------------------------- |
297 | Driver Interface | 246 | Driver Interface |
298 | -------------------------------------------------------------------------- */ | 247 | -------------------------------------------------------------------------- */ |
@@ -537,14 +486,10 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
537 | 486 | ||
538 | per_cpu(processors, pr->id) = pr; | 487 | per_cpu(processors, pr->id) = pr; |
539 | 488 | ||
540 | result = acpi_processor_add_fs(device); | ||
541 | if (result) | ||
542 | goto err_free_cpumask; | ||
543 | |||
544 | sysdev = get_cpu_sysdev(pr->id); | 489 | sysdev = get_cpu_sysdev(pr->id); |
545 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { | 490 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { |
546 | result = -EFAULT; | 491 | result = -EFAULT; |
547 | goto err_remove_fs; | 492 | goto err_free_cpumask; |
548 | } | 493 | } |
549 | 494 | ||
550 | #ifdef CONFIG_CPU_FREQ | 495 | #ifdef CONFIG_CPU_FREQ |
@@ -590,8 +535,6 @@ err_thermal_unregister: | |||
590 | thermal_cooling_device_unregister(pr->cdev); | 535 | thermal_cooling_device_unregister(pr->cdev); |
591 | err_power_exit: | 536 | err_power_exit: |
592 | acpi_processor_power_exit(pr, device); | 537 | acpi_processor_power_exit(pr, device); |
593 | err_remove_fs: | ||
594 | acpi_processor_remove_fs(device); | ||
595 | err_free_cpumask: | 538 | err_free_cpumask: |
596 | free_cpumask_var(pr->throttling.shared_cpu_map); | 539 | free_cpumask_var(pr->throttling.shared_cpu_map); |
597 | 540 | ||
@@ -620,8 +563,6 @@ static int acpi_processor_remove(struct acpi_device *device, int type) | |||
620 | 563 | ||
621 | sysfs_remove_link(&device->dev.kobj, "sysdev"); | 564 | sysfs_remove_link(&device->dev.kobj, "sysdev"); |
622 | 565 | ||
623 | acpi_processor_remove_fs(device); | ||
624 | |||
625 | if (pr->cdev) { | 566 | if (pr->cdev) { |
626 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); | 567 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); |
627 | sysfs_remove_link(&pr->cdev->device.kobj, "device"); | 568 | sysfs_remove_link(&pr->cdev->device.kobj, "device"); |
@@ -854,12 +795,6 @@ static int __init acpi_processor_init(void) | |||
854 | 795 | ||
855 | memset(&errata, 0, sizeof(errata)); | 796 | memset(&errata, 0, sizeof(errata)); |
856 | 797 | ||
857 | #ifdef CONFIG_ACPI_PROCFS | ||
858 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); | ||
859 | if (!acpi_processor_dir) | ||
860 | return -ENOMEM; | ||
861 | #endif | ||
862 | |||
863 | if (!cpuidle_register_driver(&acpi_idle_driver)) { | 798 | if (!cpuidle_register_driver(&acpi_idle_driver)) { |
864 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", | 799 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", |
865 | acpi_idle_driver.name); | 800 | acpi_idle_driver.name); |
@@ -885,10 +820,6 @@ static int __init acpi_processor_init(void) | |||
885 | out_cpuidle: | 820 | out_cpuidle: |
886 | cpuidle_unregister_driver(&acpi_idle_driver); | 821 | cpuidle_unregister_driver(&acpi_idle_driver); |
887 | 822 | ||
888 | #ifdef CONFIG_ACPI_PROCFS | ||
889 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | ||
890 | #endif | ||
891 | |||
892 | return result; | 823 | return result; |
893 | } | 824 | } |
894 | 825 | ||
@@ -907,10 +838,6 @@ static void __exit acpi_processor_exit(void) | |||
907 | 838 | ||
908 | cpuidle_unregister_driver(&acpi_idle_driver); | 839 | cpuidle_unregister_driver(&acpi_idle_driver); |
909 | 840 | ||
910 | #ifdef CONFIG_ACPI_PROCFS | ||
911 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | ||
912 | #endif | ||
913 | |||
914 | return; | 841 | return; |
915 | } | 842 | } |
916 | 843 | ||
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index ff3632717c51..4a0eec5dd24a 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c | |||
@@ -32,10 +32,6 @@ | |||
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 | ||
36 | #include <linux/proc_fs.h> | ||
37 | #include <linux/seq_file.h> | ||
38 | #endif | ||
39 | 35 | ||
40 | #include <asm/io.h> | 36 | #include <asm/io.h> |
41 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
@@ -1216,113 +1212,3 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr) | |||
1216 | return result; | 1212 | return result; |
1217 | } | 1213 | } |
1218 | 1214 | ||
1219 | #ifdef CONFIG_ACPI_PROCFS | ||
1220 | /* proc interface */ | ||
1221 | static int acpi_processor_throttling_seq_show(struct seq_file *seq, | ||
1222 | void *offset) | ||
1223 | { | ||
1224 | struct acpi_processor *pr = seq->private; | ||
1225 | int i = 0; | ||
1226 | int result = 0; | ||
1227 | |||
1228 | if (!pr) | ||
1229 | goto end; | ||
1230 | |||
1231 | if (!(pr->throttling.state_count > 0)) { | ||
1232 | seq_puts(seq, "<not supported>\n"); | ||
1233 | goto end; | ||
1234 | } | ||
1235 | |||
1236 | result = acpi_processor_get_throttling(pr); | ||
1237 | |||
1238 | if (result) { | ||
1239 | seq_puts(seq, | ||
1240 | "Could not determine current throttling state.\n"); | ||
1241 | goto end; | ||
1242 | } | ||
1243 | |||
1244 | seq_printf(seq, "state count: %d\n" | ||
1245 | "active state: T%d\n" | ||
1246 | "state available: T%d to T%d\n", | ||
1247 | pr->throttling.state_count, pr->throttling.state, | ||
1248 | pr->throttling_platform_limit, | ||
1249 | pr->throttling.state_count - 1); | ||
1250 | |||
1251 | seq_puts(seq, "states:\n"); | ||
1252 | if (pr->throttling.acpi_processor_get_throttling == | ||
1253 | acpi_processor_get_throttling_fadt) { | ||
1254 | for (i = 0; i < pr->throttling.state_count; i++) | ||
1255 | seq_printf(seq, " %cT%d: %02d%%\n", | ||
1256 | (i == pr->throttling.state ? '*' : ' '), i, | ||
1257 | (pr->throttling.states[i].performance ? pr-> | ||
1258 | throttling.states[i].performance / 10 : 0)); | ||
1259 | } else { | ||
1260 | for (i = 0; i < pr->throttling.state_count; i++) | ||
1261 | seq_printf(seq, " %cT%d: %02d%%\n", | ||
1262 | (i == pr->throttling.state ? '*' : ' '), i, | ||
1263 | (int)pr->throttling.states_tss[i]. | ||
1264 | freqpercentage); | ||
1265 | } | ||
1266 | |||
1267 | end: | ||
1268 | return 0; | ||
1269 | } | ||
1270 | |||
1271 | static int acpi_processor_throttling_open_fs(struct inode *inode, | ||
1272 | struct file *file) | ||
1273 | { | ||
1274 | return single_open(file, acpi_processor_throttling_seq_show, | ||
1275 | PDE(inode)->data); | ||
1276 | } | ||
1277 | |||
1278 | static ssize_t acpi_processor_write_throttling(struct file *file, | ||
1279 | const char __user * buffer, | ||
1280 | size_t count, loff_t * data) | ||
1281 | { | ||
1282 | int result = 0; | ||
1283 | struct seq_file *m = file->private_data; | ||
1284 | struct acpi_processor *pr = m->private; | ||
1285 | char state_string[5] = ""; | ||
1286 | char *charp = NULL; | ||
1287 | size_t state_val = 0; | ||
1288 | char tmpbuf[5] = ""; | ||
1289 | |||
1290 | if (!pr || (count > sizeof(state_string) - 1)) | ||
1291 | return -EINVAL; | ||
1292 | |||
1293 | if (copy_from_user(state_string, buffer, count)) | ||
1294 | return -EFAULT; | ||
1295 | |||
1296 | state_string[count] = '\0'; | ||
1297 | if ((count > 0) && (state_string[count-1] == '\n')) | ||
1298 | state_string[count-1] = '\0'; | ||
1299 | |||
1300 | charp = state_string; | ||
1301 | if ((state_string[0] == 't') || (state_string[0] == 'T')) | ||
1302 | charp++; | ||
1303 | |||
1304 | state_val = simple_strtoul(charp, NULL, 0); | ||
1305 | if (state_val >= pr->throttling.state_count) | ||
1306 | return -EINVAL; | ||
1307 | |||
1308 | snprintf(tmpbuf, 5, "%zu", state_val); | ||
1309 | |||
1310 | if (strcmp(tmpbuf, charp) != 0) | ||
1311 | return -EINVAL; | ||
1312 | |||
1313 | result = acpi_processor_set_throttling(pr, state_val, false); | ||
1314 | if (result) | ||
1315 | return result; | ||
1316 | |||
1317 | return count; | ||
1318 | } | ||
1319 | |||
1320 | const struct file_operations acpi_processor_throttling_fops = { | ||
1321 | .owner = THIS_MODULE, | ||
1322 | .open = acpi_processor_throttling_open_fs, | ||
1323 | .read = seq_read, | ||
1324 | .write = acpi_processor_write_throttling, | ||
1325 | .llseek = seq_lseek, | ||
1326 | .release = single_release, | ||
1327 | }; | ||
1328 | #endif | ||
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index e5dbedb16bbf..51ae3794ec7f 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -484,6 +484,8 @@ acpi_sbs_add_fs(struct proc_dir_entry **dir, | |||
484 | const struct file_operations *state_fops, | 484 | const struct file_operations *state_fops, |
485 | const struct file_operations *alarm_fops, void *data) | 485 | const struct file_operations *alarm_fops, void *data) |
486 | { | 486 | { |
487 | printk(KERN_WARNING PREFIX "Deprecated procfs I/F for SBS is loaded," | ||
488 | " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n"); | ||
487 | if (!*dir) { | 489 | if (!*dir) { |
488 | *dir = proc_mkdir(dir_name, parent_dir); | 490 | *dir = proc_mkdir(dir_name, parent_dir); |
489 | if (!*dir) { | 491 | if (!*dir) { |