[COMMON] cpufreq: acme: Move cooling register to cpufreq_init
authorChungwoo Park <cww.park@samsung.com>
Tue, 15 May 2018 12:52:48 +0000 (21:52 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:37:41 +0000 (17:37 +0900)
cpufreq->exit() callback will be called at disable_nonboot_cpus()
Then, wakeup_source is activated by cooling_unregister.
So, we moved cooling_register at exynos_cpuferq_init() as before.

Change-Id: Ic92c602d7616a99da4e272a5feb656c51b1757da
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/cpufreq/exynos-acme.c

index 959a2220b160ad903cdf627d2a5624ab8a669682..a5e205534f7378cdaab4a20e17e50353ce9c38cb 100644 (file)
@@ -466,24 +466,10 @@ static int exynos_cpufreq_resume(struct cpufreq_policy *policy)
 
 static void exynos_cpufreq_ready(struct cpufreq_policy *policy)
 {
-       struct exynos_cpufreq_domain *domain = find_domain(policy->cpu);
-
-       domain->cdev = exynos_cpufreq_cooling_register(domain->dn, policy);
-       if (IS_ERR(domain->cdev)) {
-               pr_err("running cpufreq without cooling device: %ld\n",
-                               PTR_ERR(domain->cdev));
-
-               domain->cdev = NULL;
-       }
 }
 
 static int exynos_cpufreq_exit(struct cpufreq_policy *policy)
 {
-       struct exynos_cpufreq_domain *domain = find_domain(policy->cpu);
-
-       if (domain->cdev)
-               cpufreq_cooling_unregister(domain->cdev);
-
        return 0;
 }
 
@@ -1686,7 +1672,12 @@ static int __init exynos_cpufreq_init(void)
         * Update frequency as soon as domain is enabled.
         */
        list_for_each_entry(domain, &domains, list) {
+               struct cpufreq_policy *policy;
                enable_domain(domain);
+               policy = cpufreq_cpu_get_raw(cpumask_first(&domain->cpus));
+               if (policy)
+                       exynos_cpufreq_cooling_register(domain->dn, policy);
+
                set_boot_qos(domain);
        }