diff options
| -rw-r--r-- | drivers/cpufreq/proc_intf.c | 5 | ||||
| -rw-r--r-- | kernel/cpufreq.c | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/drivers/cpufreq/proc_intf.c b/drivers/cpufreq/proc_intf.c index 253dab930b06..dc89b83710b8 100644 --- a/drivers/cpufreq/proc_intf.c +++ b/drivers/cpufreq/proc_intf.c @@ -209,10 +209,7 @@ static int __init cpufreq_proc_init (void) { struct proc_dir_entry *entry = NULL; - if (!cpufreq_driver) - return -ENODEV; - - /* are these acceptable values? */ + /* are these acceptable values? */ entry = create_proc_entry("cpufreq", S_IFREG|S_IRUGO|S_IWUSR, &proc_root); diff --git a/kernel/cpufreq.c b/kernel/cpufreq.c index 8446f4d97a85..d6e15f1a27f1 100644 --- a/kernel/cpufreq.c +++ b/kernel/cpufreq.c @@ -29,12 +29,9 @@ * level driver of CPUFreq support, and its locking mutex. * cpu_max_freq is in kHz. */ -struct cpufreq_driver *cpufreq_driver; +static struct cpufreq_driver *cpufreq_driver; static DECLARE_MUTEX (cpufreq_driver_sem); -/* required for the proc interface, remove when that goes away */ -EXPORT_SYMBOL_GPL(cpufreq_driver); - /** * Two notifier lists: the "policy" list is involved in the * validation process for a new CPU frequency policy; the @@ -58,6 +55,9 @@ static int cpufreq_cpu_get(unsigned int cpu) { if (cpu >= NR_CPUS) return 0; + if (!cpufreq_driver) + return 0; + if (!try_module_get(cpufreq_driver->owner)) return 0; |
