Skip to content

Commit

Permalink
[CPUFREQ] [2/2] demand load governor modules.
Browse files Browse the repository at this point in the history
Demand-load cpufreq governor modules if needed.

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Dave Jones <davej@redhat.com>
  • Loading branch information
Jeremy Fitzhardinge authored and Dave Jones committed Jul 31, 2006
1 parent 3bcb09a commit ea71497
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ea71497

Please sign in to comment.