Remove the deprecated /proc/cpufreq interface. The same input is available using cpufreq-info --proc from cpufrequtils. Signed-off-by: Dominik Brodowski --- drivers/cpufreq/Kconfig | 12 -- drivers/cpufreq/Makefile | 1 drivers/cpufreq/cpufreq.c | 2 drivers/cpufreq/proc_intf.c | 263 -------------------------------------------- include/linux/cpufreq.h | 3 5 files changed, 1 insertion(+), 280 deletions(-) Index: 2.6.10-rc3/drivers/cpufreq/Kconfig =================================================================== --- 2.6.10-rc3.orig/drivers/cpufreq/Kconfig 2004-12-13 19:47:25.033784085 +0100 +++ 2.6.10-rc3/drivers/cpufreq/Kconfig 2004-12-13 19:48:26.242248827 +0100 @@ -43,18 +43,6 @@ This will show detail CPU frequency translation table in sysfs file system -config CPU_FREQ_PROC_INTF - tristate "/proc/cpufreq interface (deprecated)" - depends on CPU_FREQ && PROC_FS - help - This enables the /proc/cpufreq interface for controlling - CPUFreq. Please note that it is recommended to use the sysfs - interface instead (which is built automatically). - - For details, take a look at . - - If in doubt, say N. - choice prompt "Default CPUFreq governor" depends on CPU_FREQ Index: 2.6.10-rc3/drivers/cpufreq/Makefile =================================================================== --- 2.6.10-rc3.orig/drivers/cpufreq/Makefile 2004-12-13 19:20:22.982805539 +0100 +++ 2.6.10-rc3/drivers/cpufreq/Makefile 2004-12-13 19:48:38.079598159 +0100 @@ -11,5 +11,4 @@ # CPUfreq cross-arch helpers obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o -obj-$(CONFIG_CPU_FREQ_PROC_INTF) += proc_intf.o Index: 2.6.10-rc3/drivers/cpufreq/cpufreq.c =================================================================== --- 2.6.10-rc3.orig/drivers/cpufreq/cpufreq.c 2004-12-13 19:20:22.980805818 +0100 +++ 2.6.10-rc3/drivers/cpufreq/cpufreq.c 2004-12-13 19:50:13.855242656 +0100 @@ -287,7 +287,7 @@ /** * cpufreq_parse_governor - parse a governor string */ -int cpufreq_parse_governor (char *str_governor, unsigned int *policy, +static int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpufreq_governor **governor) { if (!cpufreq_driver) Index: 2.6.10-rc3/drivers/cpufreq/proc_intf.c =================================================================== --- 2.6.10-rc3.orig/drivers/cpufreq/proc_intf.c 2004-10-21 19:34:57.000000000 +0200 +++ 2.6.10-rc3/drivers/cpufreq/proc_intf.c 2004-12-13 18:37:01.720111248 +0100 @@ -1,263 +0,0 @@ -/* - * linux/drivers/cpufreq/proc_intf.c - * - * Copyright (C) 2002 - 2003 Dominik Brodowski - */ - -#include -#include -#include -#include -#include -#include -#include - -#warning This module will be removed from the 2.6. kernel series soon after 2005-01-01 - -#define CPUFREQ_ALL_CPUS ((NR_CPUS)) - -static unsigned int warning_print = 0; - -/** - * cpufreq_parse_policy - parse a policy string - * @input_string: the string to parse. - * @policy: the policy written inside input_string - * - * This function parses a "policy string" - something the user echo'es into - * /proc/cpufreq or gives as boot parameter - into a struct cpufreq_policy. - * If there are invalid/missing entries, they are replaced with current - * cpufreq policy. - */ -static int cpufreq_parse_policy(char input_string[42], struct cpufreq_policy *policy) -{ - unsigned int min = 0; - unsigned int max = 0; - unsigned int cpu = 0; - char str_governor[16]; - struct cpufreq_policy current_policy; - unsigned int result = -EFAULT; - - if (!policy) - return -EINVAL; - - policy->min = 0; - policy->max = 0; - policy->policy = 0; - policy->cpu = CPUFREQ_ALL_CPUS; - - if (sscanf(input_string, "%d:%d:%d:%15s", &cpu, &min, &max, str_governor) == 4) - { - policy->min = min; - policy->max = max; - policy->cpu = cpu; - result = 0; - goto scan_policy; - } - if (sscanf(input_string, "%d%%%d%%%d%%%15s", &cpu, &min, &max, str_governor) == 4) - { - if (!cpufreq_get_policy(¤t_policy, cpu)) { - policy->min = (min * current_policy.cpuinfo.max_freq) / 100; - policy->max = (max * current_policy.cpuinfo.max_freq) / 100; - policy->cpu = cpu; - result = 0; - goto scan_policy; - } - } - - if (sscanf(input_string, "%d:%d:%15s", &min, &max, str_governor) == 3) - { - policy->min = min; - policy->max = max; - result = 0; - goto scan_policy; - } - - if (sscanf(input_string, "%d%%%d%%%15s", &min, &max, str_governor) == 3) - { - if (!cpufreq_get_policy(¤t_policy, cpu)) { - policy->min = (min * current_policy.cpuinfo.max_freq) / 100; - policy->max = (max * current_policy.cpuinfo.max_freq) / 100; - result = 0; - goto scan_policy; - } - } - - return -EINVAL; - -scan_policy: - result = cpufreq_parse_governor(str_governor, &policy->policy, &policy->governor); - - return result; -} - -/** - * cpufreq_proc_read - read /proc/cpufreq - * - * This function prints out the current cpufreq policy. - */ -static int cpufreq_proc_read ( - char *page, - char **start, - off_t off, - int count, - int *eof, - void *data) -{ - char *p = page; - int len = 0; - struct cpufreq_policy policy; - unsigned int min_pctg = 0; - unsigned int max_pctg = 0; - unsigned int i = 0; - - if (off != 0) - goto end; - - if (!warning_print) { - warning_print++; - printk(KERN_INFO "Access to /proc/cpufreq is deprecated and " - "will be removed from (new) 2.6. kernels soon " - "after 2005-01-01\n"); - } - - p += sprintf(p, " minimum CPU frequency - maximum CPU frequency - policy\n"); - for (i=0;iname); - } -end: - len = (p - page); - if (len <= off+count) - *eof = 1; - *start = page + off; - len -= off; - if (len>count) - len = count; - if (len<0) - len = 0; - - return len; -} - - -/** - * cpufreq_proc_write - handles writing into /proc/cpufreq - * - * This function calls the parsing script and then sets the policy - * accordingly. - */ -static int cpufreq_proc_write ( - struct file *file, - const char __user *buffer, - unsigned long count, - void *data) -{ - int result = 0; - char proc_string[42] = {'\0'}; - struct cpufreq_policy policy; - unsigned int i = 0; - - - if ((count > sizeof(proc_string) - 1)) - return -EINVAL; - - if (copy_from_user(proc_string, buffer, count)) - return -EFAULT; - - if (!warning_print) { - warning_print++; - printk(KERN_INFO "Access to /proc/cpufreq is deprecated and " - "will be removed from (new) 2.6. kernels soon " - "after 2005-01-01\n"); - } - - proc_string[count] = '\0'; - - result = cpufreq_parse_policy(proc_string, &policy); - if (result) - return -EFAULT; - - if (policy.cpu == CPUFREQ_ALL_CPUS) - { - for (i=0; iread_proc = cpufreq_proc_read; - entry->write_proc = cpufreq_proc_write; - } - - return 0; -} - - -/** - * cpufreq_proc_exit - removes "cpufreq" from the /proc root directory. - * - * This function removes "cpufreq" from the /proc root directory. - */ -static void __exit cpufreq_proc_exit (void) -{ - remove_proc_entry("cpufreq", &proc_root); - return; -} - -MODULE_AUTHOR ("Dominik Brodowski "); -MODULE_DESCRIPTION ("CPUfreq /proc/cpufreq interface"); -MODULE_LICENSE ("GPL"); - -module_init(cpufreq_proc_init); -module_exit(cpufreq_proc_exit); Index: 2.6.10-rc3/include/linux/cpufreq.h =================================================================== --- 2.6.10-rc3.orig/include/linux/cpufreq.h 2004-12-13 19:47:09.064011001 +0100 +++ 2.6.10-rc3/include/linux/cpufreq.h 2004-12-13 19:49:50.440507741 +0100 @@ -252,9 +252,6 @@ /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ unsigned int cpufreq_get(unsigned int cpu); -/* the proc_intf.c needs this */ -int cpufreq_parse_governor (char *str_governor, unsigned int *policy, struct cpufreq_governor **governor); - /********************************************************************* * CPUFREQ DEFAULT GOVERNOR *