diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-01-02 02:04:30 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-01-23 16:49:34 -0500 |
commit | bc68b7dfda54373fb5d0cee8c44a070d590b8433 (patch) | |
tree | 8bd57ab09602bf5018351b09bd60606e2da8726d | |
parent | d92d50a4622b55cf114033309286696b3bd0fa5b (diff) |
cpufreq: update driver_data->flags only if we are registering driver
We should first check if a cpufreq driver is already registered or not
before updating driver_data->flags.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 420f270a0475..0247da2a3350 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -2440,9 +2440,6 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
2440 | 2440 | ||
2441 | pr_debug("trying to register driver %s\n", driver_data->name); | 2441 | pr_debug("trying to register driver %s\n", driver_data->name); |
2442 | 2442 | ||
2443 | if (driver_data->setpolicy) | ||
2444 | driver_data->flags |= CPUFREQ_CONST_LOOPS; | ||
2445 | |||
2446 | write_lock_irqsave(&cpufreq_driver_lock, flags); | 2443 | write_lock_irqsave(&cpufreq_driver_lock, flags); |
2447 | if (cpufreq_driver) { | 2444 | if (cpufreq_driver) { |
2448 | write_unlock_irqrestore(&cpufreq_driver_lock, flags); | 2445 | write_unlock_irqrestore(&cpufreq_driver_lock, flags); |
@@ -2451,6 +2448,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
2451 | cpufreq_driver = driver_data; | 2448 | cpufreq_driver = driver_data; |
2452 | write_unlock_irqrestore(&cpufreq_driver_lock, flags); | 2449 | write_unlock_irqrestore(&cpufreq_driver_lock, flags); |
2453 | 2450 | ||
2451 | if (driver_data->setpolicy) | ||
2452 | driver_data->flags |= CPUFREQ_CONST_LOOPS; | ||
2453 | |||
2454 | if (cpufreq_boost_supported()) { | 2454 | if (cpufreq_boost_supported()) { |
2455 | /* | 2455 | /* |
2456 | * Check if driver provides function to enable boost - | 2456 | * Check if driver provides function to enable boost - |