mediatek: backport a hell of thermal commits
[openwrt/staging/jow.git] / target / linux / mediatek / patches-6.1 / 830-v6.4-14-thermal-Use-thermal_zone_device_type-accessor.patch
1 From 66b3a292d3fc749e8ec7ac5278a17e8a5757ecbc Mon Sep 17 00:00:00 2001
2 From: Daniel Lezcano <daniel.lezcano@linaro.org>
3 Date: Wed, 1 Mar 2023 21:14:41 +0100
4 Subject: [PATCH 10/42] thermal: Use thermal_zone_device_type() accessor
5
6 Replace the accesses to 'tz->type' by its accessor version in order to
7 self-encapsulate the thermal_zone_device structure.
8
9 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
10 Reviewed-by: Ido Schimmel <idosch@nvidia.com> #mlxsw
11 Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #MediaTek LVTS
12 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
13 ---
14 drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 +-
15 drivers/thermal/mediatek/lvts_thermal.c | 6 ++++--
16 drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
17 3 files changed, 6 insertions(+), 4 deletions(-)
18
19 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
20 +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
21 @@ -168,7 +168,7 @@ mlxsw_thermal_module_trips_update(struct
22
23 if (crit_temp > emerg_temp) {
24 dev_warn(dev, "%s : Critical threshold %d is above emergency threshold %d\n",
25 - tz->tzdev->type, crit_temp, emerg_temp);
26 + thermal_zone_device_type(tz->tzdev), crit_temp, emerg_temp);
27 return 0;
28 }
29
30 --- a/drivers/thermal/mediatek/lvts_thermal.c
31 +++ b/drivers/thermal/mediatek/lvts_thermal.c
32 @@ -305,7 +305,8 @@ static int lvts_set_trips(struct thermal
33 * 14-0 : Raw temperature for threshold
34 */
35 if (low != -INT_MAX) {
36 - pr_debug("%s: Setting low limit temperature interrupt: %d\n", tz->type, low);
37 + pr_debug("%s: Setting low limit temperature interrupt: %d\n",
38 + thermal_zone_device_type(tz), low);
39 writel(raw_low, LVTS_H2NTHRE(base));
40 }
41
42 @@ -318,7 +319,8 @@ static int lvts_set_trips(struct thermal
43 *
44 * 14-0 : Raw temperature for threshold
45 */
46 - pr_debug("%s: Setting high limit temperature interrupt: %d\n", tz->type, high);
47 + pr_debug("%s: Setting high limit temperature interrupt: %d\n",
48 + thermal_zone_device_type(tz), high);
49 writel(raw_high, LVTS_HTHRE(base));
50
51 return 0;
52 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
53 +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
54 @@ -44,7 +44,7 @@ static void ti_thermal_work(struct work_
55 thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
56
57 dev_dbg(data->bgp->dev, "updated thermal zone %s\n",
58 - data->ti_thermal->type);
59 + thermal_zone_device_type(data->ti_thermal));
60 }
61
62 /**