cpufreq: qoriq: Fix cooling device registration issue during suspend
authorJia Hongtao <hongtao.jia@nxp.com>
Tue, 19 Apr 2016 09:00:07 +0000 (17:00 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Apr 2016 14:07:02 +0000 (16:07 +0200)
Cooling device is registered by ready callback. It's also invoked while
system resuming from sleep (Enabling non-boot cpus). Thus cooling device
may be multiple registered. Matchable unregistration is added to exit
callback to fix this issue.

Signed-off-by: Jia Hongtao <hongtao.jia@nxp.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/qoriq-cpufreq.c

index e029079ee302e871f45abb187fb1714d604c6afa..53d8c3fb16f67bfc5a4cba5065c32a5503be4328 100644 (file)
@@ -305,6 +305,7 @@ static int qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 {
        struct cpu_data *data = policy->driver_data;
 
+       cpufreq_cooling_unregister(data->cdev);
        kfree(data->pclk);
        kfree(data->table);
        kfree(data);