Skip to content

Commit

Permalink
cpufreq: update driver_data->flags only if we are registering driver
Browse files Browse the repository at this point in the history
We should first check if a cpufreq driver is already registered or not
before updating driver_data->flags.

Signed-off-by: Viresh Kumar <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
vireshk authored and rafaeljw committed Jan 23, 2015
1 parent d92d50a commit bc68b7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2440,9 +2440,6 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)

pr_debug("trying to register driver %s\n", driver_data->name);

if (driver_data->setpolicy)
driver_data->flags |= CPUFREQ_CONST_LOOPS;

write_lock_irqsave(&cpufreq_driver_lock, flags);
if (cpufreq_driver) {
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
Expand All @@ -2451,6 +2448,9 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
cpufreq_driver = driver_data;
write_unlock_irqrestore(&cpufreq_driver_lock, flags);

if (driver_data->setpolicy)
driver_data->flags |= CPUFREQ_CONST_LOOPS;

if (cpufreq_boost_supported()) {
/*
* Check if driver provides function to enable boost -
Expand Down

0 comments on commit bc68b7d

Please sign in to comment.