Skip to contentSkip to conversation

thermal: TI: remove TI_THERMAL dependency on CPU_THERMAL

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 2 messages Oct 4, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 thermal: TI: remove TI_THERMAL dependency on CPU_THERMAL

Cover cpufreq_get_current_driver() call in ti-thermal-common.c with CPU_FREQ ifdefs and remove no longer needed CPU_THERMAL dependency from TI_THERMAL config option (stubs for other cpufreq functions for CPU_THERMAL=n case are already available).

Please note that this enables TI_THERMAL config option in the final config derived from omap2plus_defconfig (which enables CPU_THERMAL config option but without CPU_FREQ one so TI_THERMAL config option was not enabled previously in the final config).

---
 drivers/thermal/ti-soc-thermal/Kconfig             | 1 -
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/ti-soc-thermal/Kconfig +0 -1
index bd4c7be..bf5d6e4 100644
@@ -13,7 +13,6 @@ config TI_SOC_THERMAL
 config TI_THERMAL
 	bool "Texas Instruments SoCs thermal framework support"
 	depends on TI_SOC_THERMAL
-	depends on CPU_THERMAL
 	help
 	  If you say yes here you want to get support for generic thermal
 	  framework for the Texas Instruments on die bandgap temperature sensor.
drivers/thermal/ti-soc-thermal/ti-thermal-common.c +2 -0
index 4f8b9af..94d91af 100644
@@ -357,10 +357,12 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
 	if (!data)
 		return -EINVAL;
 
+#ifdef CONFIG_CPU_FREQ
 	if (!cpufreq_get_current_driver()) {
 		dev_dbg(bgp->dev, "no cpufreq driver yet\n");
 		return -EPROBE_DEFER;
 	}
+#endif
 
 	/* Register cooling device */
 	data->cool_dev = cpufreq_cooling_register(cpu_present_mask);
Signature · 1 line
1.8.2.3
#1 lore raw
Quoted 22 lines · Bartlomiej Zolnierkiewicz

Cover cpufreq_get_current_driver() call in ti-thermal-common.c with CPU_FREQ ifdefs and remove no longer needed CPU_THERMAL dependency from TI_THERMAL config option (stubs for other cpufreq functions for CPU_THERMAL=n case are already available).

Please note that this enables TI_THERMAL config option in the final config derived from omap2plus_defconfig (which enables CPU_THERMAL config option but without CPU_FREQ one so TI_THERMAL config option was not enabled previously in the final config).

---
 drivers/thermal/ti-soc-thermal/Kconfig             | 1 -
 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/ti-soc-thermal/Kconfig +0 -0
index bd4c7be..bf5d6e4 100644

drivers/thermal/ti-soc-thermal/Kconfig config TI_SOC_THERMAL · line 16

Quoted 4 lines
drivers/thermal/ti-soc-thermal/Kconfig +0 -1
@@ -13,7 +13,6 @@ config TI_SOC_THERMAL
 config TI_THERMAL
 	bool "Texas Instruments SoCs thermal framework support"
 	depends on TI_SOC_THERMAL
-	depends on CPU_THERMAL

Until the code that uses cpu thermal is still present in the driver, I would prefer to have this dependency, for runtime proper behavior. The driver design is still to take the responsibility to load the cpufreq cooling device. Up to now they are still dependent.

Quoted 8 lines
drivers/thermal/ti-soc-thermal/Kconfig +0 -0
 	help
 	  If you say yes here you want to get support for generic thermal
 	  framework for the Texas Instruments on die bandgap temperature sensor.
drivers/thermal/ti-soc-thermal/ti-thermal-common.c +0 -0
index 4f8b9af..94d91af 100644

drivers/thermal/ti-soc-thermal/ti-thermal-common.c int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id) · line 365

Quoted 9 lines
drivers/thermal/ti-soc-thermal/ti-thermal-common.c +2 -0
@@ -357,10 +357,12 @@ int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
 	if (!data)
 		return -EINVAL;
 
+#ifdef CONFIG_CPU_FREQ
 	if (!cpufreq_get_current_driver()) {
 		dev_dbg(bgp->dev, "no cpufreq driver yet\n");
 		return -EPROBE_DEFER;
 	}
+#endif

I would prefer not to have this ifdef here.

Quoted 4 lines
drivers/thermal/ti-soc-thermal/ti-thermal-common.c +0 -0
 	/* Register cooling device */
 	data->cool_dev = cpufreq_cooling_register(cpu_present_mask);
 
Signature · 3 lines
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin