[CPUFREQ] Remove deprecated /proc/acpi/processor/performance write support
authorThomas Renninger <trenn@suse.de>
Thu, 19 Apr 2007 13:49:09 +0000 (15:49 +0200)
committerDave Jones <davej@redhat.com>
Thu, 26 Apr 2007 18:32:02 +0000 (14:32 -0400)
Remove deprecated /proc/acpi/processor/performance write support

Writing to /proc/acpi/processor/xy/performance interferes with sysfs
cpufreq interface. Also removes buggy cpufreq_set_policy exported symbol.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Dave Jones <davej@redhat.com>
drivers/acpi/processor_perflib.c
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h

index 2f2e796..c4efc0c 100644 (file)
@@ -433,49 +433,6 @@ static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
                           PDE(inode)->data);
 }
 
-static ssize_t
-acpi_processor_write_performance(struct file *file,
-                                const char __user * buffer,
-                                size_t count, loff_t * data)
-{
-       int result = 0;
-       struct seq_file *m = file->private_data;
-       struct acpi_processor *pr = m->private;
-       struct acpi_processor_performance *perf;
-       char state_string[12] = { '\0' };
-       unsigned int new_state = 0;
-       struct cpufreq_policy policy;
-
-
-       if (!pr || (count > sizeof(state_string) - 1))
-               return -EINVAL;
-
-       perf = pr->performance;
-       if (!perf)
-               return -EINVAL;
-
-       if (copy_from_user(state_string, buffer, count))
-               return -EFAULT;
-
-       state_string[count] = '\0';
-       new_state = simple_strtoul(state_string, NULL, 0);
-
-       if (new_state >= perf->state_count)
-               return -EINVAL;
-
-       cpufreq_get_policy(&policy, pr->id);
-
-       policy.cpu = pr->id;
-       policy.min = perf->states[new_state].core_frequency * 1000;
-       policy.max = perf->states[new_state].core_frequency * 1000;
-
-       result = cpufreq_set_policy(&policy);
-       if (result)
-               return result;
-
-       return count;
-}
-
 static void acpi_cpufreq_add_file(struct acpi_processor *pr)
 {
        struct proc_dir_entry *entry = NULL;
@@ -487,10 +444,9 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr)
 
        /* add file 'performance' [R/W] */
        entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE,
-                                 S_IFREG | S_IRUGO | S_IWUSR,
+                                 S_IFREG | S_IRUGO,
                                  acpi_device_dir(device));
        if (entry){
-               acpi_processor_perf_fops.write = acpi_processor_write_performance;
                entry->proc_fops = &acpi_processor_perf_fops;
                entry->data = acpi_driver_data(device);
                entry->owner = THIS_MODULE;
index fcb86dd..893dbaf 100644 (file)
@@ -1626,43 +1626,6 @@ error_out:
 }
 
 /**
- *     cpufreq_set_policy - set a new CPUFreq policy
- *     @policy: policy to be set.
- *
- *     Sets a new CPU frequency and voltage scaling policy.
- */
-int cpufreq_set_policy(struct cpufreq_policy *policy)
-{
-       int ret = 0;
-       struct cpufreq_policy *data;
-
-       if (!policy)
-               return -EINVAL;
-
-       data = cpufreq_cpu_get(policy->cpu);
-       if (!data)
-               return -EINVAL;
-
-       if (unlikely(lock_policy_rwsem_write(policy->cpu)))
-               return -EINVAL;
-
-
-       ret = __cpufreq_set_policy(data, policy);
-       data->user_policy.min = data->min;
-       data->user_policy.max = data->max;
-       data->user_policy.policy = data->policy;
-       data->user_policy.governor = data->governor;
-
-       unlock_policy_rwsem_write(policy->cpu);
-
-       cpufreq_cpu_put(data);
-
-       return ret;
-}
-EXPORT_SYMBOL(cpufreq_set_policy);
-
-
-/**
  *     cpufreq_update_policy - re-evaluate an existing cpufreq policy
  *     @cpu: CPU which shall be re-evaluated
  *
index 0899e2c..3ec6e7f 100644 (file)
@@ -257,7 +257,6 @@ struct freq_attr {
 /*********************************************************************
  *                        CPUFREQ 2.6. INTERFACE                     *
  *********************************************************************/
-int cpufreq_set_policy(struct cpufreq_policy *policy);
 int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
 int cpufreq_update_policy(unsigned int cpu);