All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] cpufreq: demand load governor modules
@ 2006-07-06 19:32 Jeremy Fitzhardinge
  0 siblings, 0 replies; only message in thread
From: Jeremy Fitzhardinge @ 2006-07-06 19:32 UTC (permalink / raw)
  To: cpufreq, Linux Kernel Mailing List

Demand-load cpufreq governor modules if needed.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>

---
 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-06 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-06 19:32 [PATCH 2/2] cpufreq: demand load governor modules Jeremy Fitzhardinge

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.