From patchwork Tue Feb 21 18:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 13148273 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE3C7C64EC7 for ; Tue, 21 Feb 2023 18:09:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231847AbjBUSJG (ORCPT ); Tue, 21 Feb 2023 13:09:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbjBUSIk (ORCPT ); Tue, 21 Feb 2023 13:08:40 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F552E829 for ; Tue, 21 Feb 2023 10:08:05 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id l2-20020a05600c1d0200b003e1f6dff952so4272167wms.1 for ; Tue, 21 Feb 2023 10:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WxOjXV0BQvNs4//4eyybGdilzG1LzEaF0NAq/aqNM8Q=; b=JT/vx6hFSQYN4c2jk7Stt6InjzZQMM0mhvzlKkKPuYT9DPtfKOsHXrx+sSqzXKmhV4 HN9xhbOFiCrS189gTkrTh3E/RW3s6hpY+u7m940QJwtr7wmvT2sHJgPehcPVIAtCT9Ar UvMyL2S1IWn42TvYQkGPwwU2DBDYMgEKb20wEvg9ToEv2NoLp3mQIxqQuWfeiY3V5b/I 2zg1mNJz3D0JZ/hfVvnCeFQxlgDbwpf4fEKFFTn1Cai6l+oQ4gBe3C4iqhC5UlQd3siB bXcwe4EyQwybr4voCX90kNGpz+328NTLLnNegXxxDf/8Vb5ETwX+XfqbHLZlVLoRRRe5 z12A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WxOjXV0BQvNs4//4eyybGdilzG1LzEaF0NAq/aqNM8Q=; b=d+5Zg0gX1u5haXEFu1TlvIJvAC+KroEHFhkADdiOQaNyfAYnh98RNz2Z3Vvp2xsi95 RdGIBprqyvLkKmw6MTKuWtZ8stElFcYunJRE4WERVskjJjxMzDltWowW8OORgCpr0dc2 RDdVgK0uF57CNS4JakxFxS2bIZs7fO+60nxjJr+MerDxBrm6W39F14Fbrso8OSIo2y6h UB6TkDaMyR73BoUa3aZr2Wn6JSLT7aRM1KxdPlecV6oQCUCC8t1M2pD0LQoucnVq+Mu6 px+j21Ei5lLas4tVsYuYvBd6jqCTRM4HdklsI+9SzMg78+z45VKtuprHDojcRpfyojfi e4HA== X-Gm-Message-State: AO0yUKWFmSvO3dpKHj3LJ8eqr/MYC7sZJa1wRnc56O4hF1xmRZj3S8zQ mhCD01v3ytCbs/yPfem6krCIOw== X-Google-Smtp-Source: AK7set+UvfuNbt1xzTlvl99AbwSUpW97o8x8EsfSehdVbZk/s/8pp5dlcoJQQ7YQr9U5gVjvwA4sTg== X-Received: by 2002:a05:600c:16d3:b0:3dc:5950:b358 with SMTP id l19-20020a05600c16d300b003dc5950b358mr10858363wmn.14.1677002883410; Tue, 21 Feb 2023 10:08:03 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:1e9:315c:bb40:e382]) by smtp.gmail.com with ESMTPSA id c128-20020a1c3586000000b003e21558ee9dsm5107815wma.2.2023.02.21.10.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 10:08:03 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Ido Schimmel , Zhang Rui , Len Brown , Petr Machata , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Amit Kucheria , Eduardo Valentin , Keerthy , Matthias Brugger , AngeloGioacchino Del Regno , Balsam CHIHI , Baolin Wang , linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER), netdev@vger.kernel.org (open list:MELLANOX ETHERNET SWITCH DRIVERS), linux-omap@vger.kernel.org (open list:TI BANDGAP AND THERMAL DRIVER), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH v2 09/16] thermal: Do not access 'type' field, use the tz id instead Date: Tue, 21 Feb 2023 19:07:03 +0100 Message-Id: <20230221180710.2781027-10-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230221180710.2781027-1-daniel.lezcano@linaro.org> References: <20230221180710.2781027-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org The 'type' field is used as a name in the message. However we can have multiple thermal zone with the same type. The information is not accurate. Moreover, the thermal zone device structure is directly accessed while we want to improve the self-encapsulation of the code. Replace the 'type' in the message by the thermal zone id. Signed-off-by: Daniel Lezcano Reviewed-by: Ido Schimmel #mlxsw Reviewed-by: AngeloGioacchino Del Regno Acked-by: Rafael J. Wysocki --- drivers/acpi/thermal.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 4 ++-- drivers/thermal/mediatek/lvts_thermal.c | 5 +---- drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 392b73b3e269..b55a3b0ad9ed 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -842,7 +842,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) goto acpi_bus_detach; dev_info(&tz->device->dev, "registered as thermal_zone%d\n", - tz->thermal_zone->id); + thermal_zone_device_get_id(tz->thermal_zone)); return 0; diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 722e4a40afef..a997fca211ba 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -176,8 +176,8 @@ 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); + dev_warn(dev, "tz id %d: Critical threshold %d is above emergency threshold %d\n", + thermal_zone_device_get_id(tz->tzdev), crit_temp, emerg_temp); return 0; } diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c index beb835d644e2..155cef8ed3f5 100644 --- a/drivers/thermal/mediatek/lvts_thermal.c +++ b/drivers/thermal/mediatek/lvts_thermal.c @@ -304,10 +304,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); + if (low != -INT_MAX) writel(raw_low, LVTS_H2NTHRE(base)); - } /* * Hot temperature threshold @@ -318,7 +316,6 @@ 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); writel(raw_high, LVTS_HTHRE(base)); return 0; diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 060f46cea5ff..488b08fc20e4 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -43,8 +43,8 @@ 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); + dev_dbg(data->bgp->dev, "updated thermal zone id %d\n", + thermal_zone_device_get_id(data->ti_thermal)); } /**