cpufreq: Do not track governor name for scaling drivers with internal governors.
authorDirk Brandewie <dirk.brandewie@gmail.com>
Wed, 6 Feb 2013 17:02:11 +0000 (09:02 -0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 9 Feb 2013 11:55:53 +0000 (12:55 +0100)
Scaling drivers that implement internal governors do not have governor
structures assocaited with them.  Only track the name of the governor
associated with the CPU if the driver does not implement
cpufreq_driver.setpolicy()

Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c

index 480c49c71afec6661ab9ddb7e3729e54f8af8fd7..94117a7f219b30726894d68e72f0eefd8d1a416a 100644 (file)
@@ -1025,8 +1025,9 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif
                __cpufreq_governor(data, CPUFREQ_GOV_STOP);
 
 #ifdef CONFIG_HOTPLUG_CPU
-       strncpy(per_cpu(cpufreq_cpu_governor, cpu), data->governor->name,
-                       CPUFREQ_NAME_LEN);
+       if (!cpufreq_driver->setpolicy)
+               strncpy(per_cpu(cpufreq_cpu_governor, cpu),
+                       data->governor->name, CPUFREQ_NAME_LEN);
 #endif
 
        WARN_ON(lock_policy_rwsem_write(cpu));