summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2006-07-06 21:32:01 +0200
committerDave Jones <davej@redhat.com>2006-08-01 00:37:06 +0200
commitea71497020c55cd39221e0abad5c1752ac6e3f47 (patch)
treecd0fb594af99f384f11b0834d6302b956bfd6f15 /drivers
parent[CPUFREQ] [1/2] add __find_governor helper and clean up some error handling. (diff)
downloadlinux-ea71497020c55cd39221e0abad5c1752ac6e3f47.tar.xz
linux-ea71497020c55cd39221e0abad5c1752ac6e3f47.zip
[CPUFREQ] [2/2] demand load governor modules.
Demand-load cpufreq governor modules if needed. Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 9b416372a8e4..b3df613ae4ec 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -321,6 +321,23 @@ static int cpufreq_parse_governor (char *str_governor, unsigned int *policy,
t = __find_governor(str_governor);
+ if (t == NULL) {
+ char *name = kasprintf(GFP_KERNEL, "cpufreq_%s", str_governor);
+
+ if (name) {
+ int ret;
+
+ mutex_unlock(&cpufreq_governor_mutex);
+ ret = request_module(name);
+ mutex_lock(&cpufreq_governor_mutex);
+
+ if (ret == 0)
+ t = __find_governor(str_governor);
+ }
+
+ kfree(name);
+ }
+
if (t != NULL) {
*governor = t;
err = 0;