thermal: Use thermal_zone_device_type() accessor
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 1 Mar 2023 20:14:41 +0000 (21:14 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 3 Mar 2023 19:45:03 +0000 (20:45 +0100)
Replace the accesses to 'tz->type' by its accessor version in order to
self-encapsulate the thermal_zone_device structure.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com> #mlxsw
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #MediaTek LVTS
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
drivers/thermal/mediatek/lvts_thermal.c
drivers/thermal/ti-soc-thermal/ti-thermal-common.c

index 722e4a4..b0a169e 100644 (file)
@@ -177,7 +177,7 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core,
 
        if (crit_temp > emerg_temp) {
                dev_warn(dev, "%s : Critical threshold %d is above emergency threshold %d\n",
-                        tz->tzdev->type, crit_temp, emerg_temp);
+                        thermal_zone_device_type(tz->tzdev), crit_temp, emerg_temp);
                return 0;
        }
 
index beb835d..216f53e 100644 (file)
@@ -305,7 +305,8 @@ static int lvts_set_trips(struct thermal_zone_device *tz, int low, int high)
         * 14-0 : Raw temperature for threshold
         */
        if (low != -INT_MAX) {
-               pr_debug("%s: Setting low limit temperature interrupt: %d\n", tz->type, low);
+               pr_debug("%s: Setting low limit temperature interrupt: %d\n",
+                        thermal_zone_device_type(tz), low);
                writel(raw_low, LVTS_H2NTHRE(base));
        }
 
@@ -318,7 +319,8 @@ static int lvts_set_trips(struct thermal_zone_device *tz, int low, int high)
         *
         * 14-0 : Raw temperature for threshold
         */
-       pr_debug("%s: Setting high limit temperature interrupt: %d\n", tz->type, high);
+       pr_debug("%s: Setting high limit temperature interrupt: %d\n",
+                thermal_zone_device_type(tz), high);
        writel(raw_high, LVTS_HTHRE(base));
 
        return 0;
index 060f46c..0c89140 100644 (file)
@@ -44,7 +44,7 @@ static void ti_thermal_work(struct work_struct *work)
        thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
 
        dev_dbg(data->bgp->dev, "updated thermal zone %s\n",
-               data->ti_thermal->type);
+               thermal_zone_device_type(data->ti_thermal));
 }
 
 /**