[PATCH 2/2] cpufreq: demand load governor modules

From: Jeremy Fitzhardinge
Date: Thu Jul 06 2006 - 15:30:22 EST


Demand-load cpufreq governor modules if needed.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxx>

---
drivers/cpufreq/cpufreq.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)


diff -r 4650553b3f11 drivers/cpufreq/cpufreq.c
--- a/drivers/cpufreq/cpufreq.c Wed Jul 05 15:21:25 2006 -0700
+++ b/drivers/cpufreq/cpufreq.c Wed Jul 05 15:25:52 2006 -0700
@@ -320,6 +320,23 @@ static int cpufreq_parse_governor (char mutex_lock(&cpufreq_governor_mutex);

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;


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/