- don't forget to save freqency when priority is raised.
- nuke redundant variable initialization.
This commit is contained in:
parent
5f36393468
commit
1fea6ce7dd
@ -260,8 +260,7 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority)
|
|||||||
if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) {
|
if (CPUFREQ_CMP(sc->curr_level.total_set.freq, level->total_set.freq)) {
|
||||||
CF_DEBUG("skipping freq %d, same as current level %d\n",
|
CF_DEBUG("skipping freq %d, same as current level %d\n",
|
||||||
level->total_set.freq, sc->curr_level.total_set.freq);
|
level->total_set.freq, sc->curr_level.total_set.freq);
|
||||||
sc->curr_priority = priority;
|
goto skip;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First, set the absolute frequency via its driver. */
|
/* First, set the absolute frequency via its driver. */
|
||||||
@ -323,6 +322,7 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip:
|
||||||
/* If we were restoring a saved state, reset it to "unused". */
|
/* If we were restoring a saved state, reset it to "unused". */
|
||||||
if (level == &sc->saved_level) {
|
if (level == &sc->saved_level) {
|
||||||
CF_DEBUG("resetting saved level\n");
|
CF_DEBUG("resetting saved level\n");
|
||||||
@ -345,7 +345,6 @@ cf_set_method(device_t dev, const struct cf_level *level, int priority)
|
|||||||
}
|
}
|
||||||
sc->curr_level = *level;
|
sc->curr_level = *level;
|
||||||
sc->curr_priority = priority;
|
sc->curr_priority = priority;
|
||||||
error = 0;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
CF_MTX_UNLOCK(&sc->lock);
|
CF_MTX_UNLOCK(&sc->lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user