diff options
author | Andrzej Pietrasiewicz <andrzej.p@collabora.com> | 2020-06-29 15:29:16 +0300 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2020-06-29 21:26:33 +0300 |
commit | 1595d887afe46b0ad721f27df895a61d4879ede2 (patch) | |
tree | 38480aa594e936d8e72bd447a35c645cbee45ee9 /drivers/thermal | |
parent | 172066cc314f104e708f700903739845d343ea39 (diff) | |
download | linux-1595d887afe46b0ad721f27df895a61d4879ede2.tar.xz |
thermal: Store thermal mode in a dedicated enum
Prepare for storing mode in struct thermal_zone_device.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
[for acerhdf]
Acked-by: Peter Kaestle <peter@piie.net>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200629122925.21729-3-andrzej.p@collabora.com
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c index 0b3a62655843..e84faaadff87 100644 --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -48,7 +48,7 @@ struct int3400_thermal_priv { struct acpi_device *adev; struct platform_device *pdev; struct thermal_zone_device *thermal; - int mode; + enum thermal_device_mode mode; int art_count; struct art *arts; int trt_count; @@ -395,24 +395,20 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal, enum thermal_device_mode mode) { struct int3400_thermal_priv *priv = thermal->devdata; - bool enable; int result = 0; if (!priv) return -EINVAL; - if (mode == THERMAL_DEVICE_ENABLED) - enable = true; - else if (mode == THERMAL_DEVICE_DISABLED) - enable = false; - else + if (mode != THERMAL_DEVICE_ENABLED && + mode != THERMAL_DEVICE_DISABLED) return -EINVAL; - if (enable != priv->mode) { - priv->mode = enable; + if (mode != priv->mode) { + priv->mode = mode; result = int3400_thermal_run_osc(priv->adev->handle, - priv->current_uuid_index, - enable); + priv->current_uuid_index, + mode == THERMAL_DEVICE_ENABLED); } evaluate_odvp(priv); |