diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 20:38:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 20:38:48 -0400 |
commit | ded1504dfa0083661fdd1a0a5f021cb7313ffe04 (patch) | |
tree | 5af71c440627225138518669653c427e901d8e33 /drivers/acpi | |
parent | 98b96173c777c67daaa7d163a35e591e1928a164 (diff) | |
parent | 2e4976206396274cf66590328c6913811c271495 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
* master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] Report the number of processors in PowerNow-k8 correctly
[CPUFREQ] do not declare undefined functions
[CPUFREQ] cleanup kconfig options
[CPUFREQ] Longhaul - Revert Longhaul ver. 2
[CPUFREQ] Remove deprecated /proc/acpi/processor/performance write support
[CPUFREQ] Fix limited cpufreq when booted on battery
Fix preemption warnings in speedstep-centrino.c
[CPUFREQ] Longhaul - Correct PCI code
[CPUFREQ] p4-clockmod: switch to rdmsr_on_cpu/wrmsr_on_cpu
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_perflib.c | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 2f2e7964226d..c4efc0c17f8f 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c | |||
@@ -433,49 +433,6 @@ static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file) | |||
433 | PDE(inode)->data); | 433 | PDE(inode)->data); |
434 | } | 434 | } |
435 | 435 | ||
436 | static ssize_t | ||
437 | acpi_processor_write_performance(struct file *file, | ||
438 | const char __user * buffer, | ||
439 | size_t count, loff_t * data) | ||
440 | { | ||
441 | int result = 0; | ||
442 | struct seq_file *m = file->private_data; | ||
443 | struct acpi_processor *pr = m->private; | ||
444 | struct acpi_processor_performance *perf; | ||
445 | char state_string[12] = { '\0' }; | ||
446 | unsigned int new_state = 0; | ||
447 | struct cpufreq_policy policy; | ||
448 | |||
449 | |||
450 | if (!pr || (count > sizeof(state_string) - 1)) | ||
451 | return -EINVAL; | ||
452 | |||
453 | perf = pr->performance; | ||
454 | if (!perf) | ||
455 | return -EINVAL; | ||
456 | |||
457 | if (copy_from_user(state_string, buffer, count)) | ||
458 | return -EFAULT; | ||
459 | |||
460 | state_string[count] = '\0'; | ||
461 | new_state = simple_strtoul(state_string, NULL, 0); | ||
462 | |||
463 | if (new_state >= perf->state_count) | ||
464 | return -EINVAL; | ||
465 | |||
466 | cpufreq_get_policy(&policy, pr->id); | ||
467 | |||
468 | policy.cpu = pr->id; | ||
469 | policy.min = perf->states[new_state].core_frequency * 1000; | ||
470 | policy.max = perf->states[new_state].core_frequency * 1000; | ||
471 | |||
472 | result = cpufreq_set_policy(&policy); | ||
473 | if (result) | ||
474 | return result; | ||
475 | |||
476 | return count; | ||
477 | } | ||
478 | |||
479 | static void acpi_cpufreq_add_file(struct acpi_processor *pr) | 436 | static void acpi_cpufreq_add_file(struct acpi_processor *pr) |
480 | { | 437 | { |
481 | struct proc_dir_entry *entry = NULL; | 438 | struct proc_dir_entry *entry = NULL; |
@@ -487,10 +444,9 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr) | |||
487 | 444 | ||
488 | /* add file 'performance' [R/W] */ | 445 | /* add file 'performance' [R/W] */ |
489 | entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, | 446 | entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, |
490 | S_IFREG | S_IRUGO | S_IWUSR, | 447 | S_IFREG | S_IRUGO, |
491 | acpi_device_dir(device)); | 448 | acpi_device_dir(device)); |
492 | if (entry){ | 449 | if (entry){ |
493 | acpi_processor_perf_fops.write = acpi_processor_write_performance; | ||
494 | entry->proc_fops = &acpi_processor_perf_fops; | 450 | entry->proc_fops = &acpi_processor_perf_fops; |
495 | entry->data = acpi_driver_data(device); | 451 | entry->data = acpi_driver_data(device); |
496 | entry->owner = THIS_MODULE; | 452 | entry->owner = THIS_MODULE; |