[PATCH] thermal: imx: skip registering legacy cooling on i.MX7

From: Andrey Smirnov
Date: Fri Jun 14 2019 - 03:46:43 EST


i.MX7 doesn't have a mainline cpufreq driver, so
imx_thermal_register_legacy_cooling() will always return -EPROBE_DEFER
preventing the driver probe from finishing. No-op
imx_thermal_register_legacy_cooling() on i.MX7 to avoid that problem.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
Cc: Chris Healy <cphealy@xxxxxxxxx>
Cc: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
Cc: Fabio Estevam <festevam@xxxxxxxxx>
Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
Cc: Eduardo Valentin <edubezval@xxxxxxxxx>
Cc: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Cc: NXP Linux Team <linux-imx@xxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
drivers/thermal/imx_thermal.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index bb6754a5342c..bfc9c6d57916 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -658,6 +658,9 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
struct device_node *np;
int ret;

+ if (data->socdata->version == TEMPMON_IMX7D)
+ return 0;
+
data->policy = cpufreq_cpu_get(0);
if (!data->policy) {
pr_debug("%s: CPUFreq policy not found\n", __func__);
--
2.21.0