From cb5aa5001e86f4635b39fa1e3955a530f8a0ced8 Mon Sep 17 00:00:00 2001 Message-Id: From: Amit Kucheria Date: Wed, 30 Jan 2019 01:37:40 +0530 Subject: [PATCH] fixup! cpufreq: Auto-register the driver as a thermal cooling device if asked --- drivers/cpufreq/cpufreq.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 0f9b50d3ee91..cd574f031318 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1319,10 +1319,9 @@ static int cpufreq_online(unsigned int cpu) if (cpufreq_driver->ready) cpufreq_driver->ready(policy); -#if IS_ENABLED(CONFIG_CPU_THERMAL) - if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) + if (IS_ENABLED(CONFIG_CPU_THERMAL) && + cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) policy->cdev = of_cpufreq_cooling_register(policy); -#endif pr_debug("initialization complete\n"); @@ -1411,12 +1410,11 @@ static int cpufreq_offline(unsigned int cpu) goto unlock; } -#if IS_ENABLED(CONFIG_CPU_THERMAL) - if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) { + if (IS_ENABLED(CONFIG_CPU_THERMAL) && + cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) { cpufreq_cooling_unregister(policy->cdev); policy->cdev = NULL; } -#endif if (cpufreq_driver->stop_cpu) cpufreq_driver->stop_cpu(policy); -- 2.17.1