diff options
author | Andrzej Pietrasiewicz <andrzej.p@collabora.com> | 2020-06-29 14:29:18 +0200 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2020-06-29 20:26:34 +0200 |
commit | 5a3506657f71d7ca124c040aff98639673c5dc97 (patch) | |
tree | 7cae0f77b9bb04ff0281c62b85b1506e467a572f /drivers/thermal/thermal_of.c | |
parent | thermal: Add current mode to thermal zone device (diff) | |
download | linux-5a3506657f71d7ca124c040aff98639673c5dc97.tar.xz linux-5a3506657f71d7ca124c040aff98639673c5dc97.zip |
thermal: Store device mode in struct thermal_zone_device
Prepare for eliminating get_mode().
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
[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-5-andrzej.p@collabora.com
Diffstat (limited to 'drivers/thermal/thermal_of.c')
-rw-r--r-- | drivers/thermal/thermal_of.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index ddf88dbe7ba2..c495b1e48ef2 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -51,7 +51,6 @@ struct __thermal_bind_params { /** * struct __thermal_zone - internal representation of a thermal zone - * @mode: current thermal zone device mode (enabled/disabled) * @passive_delay: polling interval while passive cooling is activated * @polling_delay: zone polling interval * @slope: slope of the temperature adjustment curve @@ -65,7 +64,6 @@ struct __thermal_bind_params { */ struct __thermal_zone { - enum thermal_device_mode mode; int passive_delay; int polling_delay; int slope; @@ -272,9 +270,7 @@ static int of_thermal_unbind(struct thermal_zone_device *thermal, static int of_thermal_get_mode(struct thermal_zone_device *tz, enum thermal_device_mode *mode) { - struct __thermal_zone *data = tz->devdata; - - *mode = data->mode; + *mode = tz->mode; return 0; } @@ -296,7 +292,7 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz, mutex_unlock(&tz->lock); - data->mode = mode; + tz->mode = mode; thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); return 0; @@ -979,7 +975,6 @@ __init *thermal_of_build_thermal_zone(struct device_node *np) finish: of_node_put(child); - tz->mode = THERMAL_DEVICE_DISABLED; return tz; @@ -1134,6 +1129,7 @@ int __init of_parse_thermal_zones(void) of_thermal_free_zone(tz); /* attempting to build remaining zones still */ } + zone->mode = THERMAL_DEVICE_DISABLED; } of_node_put(np); |