diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2019-11-05 09:53:32 +0800 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:44:16 +0800 |
commit | 1d79088bb74d4096168d46a4e441e2ff49e2656b (patch) | |
tree | dd66597b1ada0f838ba7f28e4fcddc3a08e66eeb /drivers/thermal | |
parent | d5e238ed4dc2fec5045fc076a98ac275d4e6e553 (diff) |
thermal: imx_sc_thermal: Add system-wide device cooling to all thermal zones
It makes more sense to trigger system-wide device cooling for
all thermal zones rather than thermal zone0 ONLY.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/imx_sc_thermal.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c index 2f3094ffd3c9..9f60b71f8c36 100644 --- a/drivers/thermal/imx_sc_thermal.c +++ b/drivers/thermal/imx_sc_thermal.c @@ -230,29 +230,26 @@ static int imx_sc_thermal_probe(struct platform_device *pdev) sensor->temp_passive = trip[0].temperature; sensor->temp_critical = trip[1].temperature; - /* first thermal zone takes care of system-wide device cooling */ - if (i == 0) { - sensor->cdev = devfreq_cooling_register(); - if (IS_ERR(sensor->cdev)) { - dev_err(&pdev->dev, - "failed to register devfreq cooling device: %d\n", - ret); - return ret; - } - - ret = thermal_zone_bind_cooling_device(sensor->tzd, - IMX_TRIP_PASSIVE, - sensor->cdev, - THERMAL_NO_LIMIT, - THERMAL_NO_LIMIT, - THERMAL_WEIGHT_DEFAULT); - if (ret) { - dev_err(&sensor->tzd->device, - "binding zone %s with cdev %s failed:%d\n", - sensor->tzd->type, sensor->cdev->type, ret); - devfreq_cooling_unregister(sensor->cdev); - return ret; - } + sensor->cdev = devfreq_cooling_register(); + if (IS_ERR(sensor->cdev)) { + dev_err(&pdev->dev, + "failed to register devfreq cooling device: %d\n", + ret); + return ret; + } + + ret = thermal_zone_bind_cooling_device(sensor->tzd, + IMX_TRIP_PASSIVE, + sensor->cdev, + THERMAL_NO_LIMIT, + THERMAL_NO_LIMIT, + THERMAL_WEIGHT_DEFAULT); + if (ret) { + dev_err(&sensor->tzd->device, + "binding zone %s with cdev %s failed:%d\n", + sensor->tzd->type, sensor->cdev->type, ret); + devfreq_cooling_unregister(sensor->cdev); + return ret; } } |