From patchwork Tue Feb 28 11:22:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 13154733 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D3EEC64EC7 for ; Tue, 28 Feb 2023 11:23:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CY0mr3hYyc1bWFPg3FNm72pCWU3T+Hmsf77lgvcpHMU=; b=FPZe0X8o/6OXRr H0GNP1OxLuDdbTKR6+oel8oWSYTjiZw5LRlFbjDn3ST7eSnIL/okKjUwgytD65/Ur+F4MpEBbo+ne 0xUh7xTQ53GAQNHC3IefSyyAou1Sr0efaJt1/vqrauQxUF02OPNufRUePUIBb/ADpoMKtMc2+UCqA Q3p0almspCLgugDHp5sG3GTPJ6oYqanVxB+bMe97DrilGZvWWPGlC9+iXpNuYkVrmC99IKYDGC3z0 DpczFEcDRHfWEoIQnT+3W5aNioBcXuo+QgLS+qi2THEEZTbdmaSqBj5j5WozDiKOAJxPZSet9cysy PtvRXjMVs3WgySyQDsig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWy4o-00Cwx1-PV; Tue, 28 Feb 2023 11:23:22 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWy4j-00Cwtf-CS for linux-rockchip@lists.infradead.org; Tue, 28 Feb 2023 11:23:20 +0000 Received: by mail-wr1-x432.google.com with SMTP id q16so9355067wrw.2 for ; Tue, 28 Feb 2023 03:23:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677583396; 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=QZORbJEC0KXh3smLya7JMCOQlYUfz0b2RxRCc6FiOfI=; b=OUmVNKtMZy71Xb4OafKHzvY+yBTEGHp3AaOzBwqcRrPW48VcxfRdVgL/WocBCGzJtz ZxQZ89JaSnLN4vzAPy4oXSbV76UCAWq6MwnoYU7Xt98ccVgnXFSSB+W8eFo/4JBWRun4 5RTjaXDyWYx9fcEt65xJdSBDso413BDd9UoqgSnXfJqQV++pALJj6fvkD3QeTsDehRms xiheHBWgBHZoxcKhGn/kKC96ggbS29KumVuYitYyqx+cegoPvxUnZ6incz5Zupgh8gqH in0/1P9bBUTVbg22Iima50actI1DwZsTKDD52gNVPfI6FvyQJtk1R/YCL6cRpq106uRr QfFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677583396; 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=QZORbJEC0KXh3smLya7JMCOQlYUfz0b2RxRCc6FiOfI=; b=arhv1GAZV+rkXPwLfKqK0gyj8m6A0lwO/33hD14VguzZ7Kq+13IJbAbXLxDAiHImr0 jLB5+lpdTaZDCE6Q1QfQDPCIDjz8OcqlGE20AjlM03nU6a3khEWIbGQluJYeWcCXaKUO UO3vkYGAOCeOMGKyxiQ56CC9nuqzqBD5O5GYcg6FPBkOPbS5VoefBxGMpRimhlVNzwAl 25LgOML8aA9eZoTORQVWsAdI13MN9nPWDoAnl1bz21Pl25ZRmtUrnT7O7BmFIOqrM5u0 hT91QfdecmjVeaXhH1w7Px8zrVzl9i5izObyormoqjpfDicBbJCKbavrca3rVb8LzwBL IY0Q== X-Gm-Message-State: AO0yUKXuVe+dC9ZRuqEaHyGrMetJBscNqA8BA5wkzYAyQLkVXE3lAcHf vPjcAIX53RGMfys+8qOd3XmM/A== X-Google-Smtp-Source: AK7set8nGAJgkg7jQ/NNy9ORVxyqvPxPJ/rta3MVNbCav4uWaPh9eKH6SIPPTSwi5PQBQxM1QbkS5g== X-Received: by 2002:a5d:5049:0:b0:2cb:5b58:75e with SMTP id h9-20020a5d5049000000b002cb5b58075emr2255214wrt.5.1677583395936; Tue, 28 Feb 2023 03:23:15 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6830:6390:2815:b6a5]) by smtp.gmail.com with ESMTPSA id z5-20020a5d6545000000b002c5501a5803sm9598130wrv.65.2023.02.28.03.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 03:23:15 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Miquel Raynal , Florian Fainelli , Amit Kucheria , Zhang Rui , Markus Mayer , Broadcom internal kernel review list , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Heiko Stuebner , AngeloGioacchino Del Regno , Adam Ward , linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support) Subject: [PATCH v4 06/19] thermal: Remove debug or error messages in get_temp() ops Date: Tue, 28 Feb 2023 12:22:25 +0100 Message-Id: <20230228112238.2312273-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230228112238.2312273-1-daniel.lezcano@linaro.org> References: <20230228112238.2312273-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_032317_492475_3D14DC27 X-CRM114-Status: GOOD ( 19.52 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Some get_temp() ops implementation are showing an error or a debug message if the reading of the sensor fails. The debug message is already displayed from the call site of this ops. So we can remove it. On the other side, the error should not be displayed because in production that can raise tons of messages. Finally, some drivers are showing a debug message with the temperature, this is also accessible through the trace from the core code in the temperature_update() function. Another benefit is the dev_* messages are accessing the thermal zone device field from the structure, so we encapsulate even more the code by preventing these accesses. Remove those messages. Signed-off-by: Daniel Lezcano Reviewed-by: Miquel Raynal #Armada Acked-by: Florian Fainelli #brcmstb_thermal.c --- drivers/thermal/armada_thermal.c | 10 ++-------- drivers/thermal/broadcom/brcmstb_thermal.c | 4 +--- drivers/thermal/dove_thermal.c | 5 +---- drivers/thermal/hisi_thermal.c | 3 --- drivers/thermal/imx_sc_thermal.c | 5 +---- drivers/thermal/imx_thermal.c | 4 +--- drivers/thermal/kirkwood_thermal.c | 5 +---- drivers/thermal/max77620_thermal.c | 4 +--- drivers/thermal/rockchip_thermal.c | 3 --- drivers/thermal/st/st_thermal.c | 3 --- drivers/thermal/thermal-generic-adc.c | 5 ++--- 11 files changed, 10 insertions(+), 41 deletions(-) diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c index ebd606861a61..0e8dfa6a7757 100644 --- a/drivers/thermal/armada_thermal.c +++ b/drivers/thermal/armada_thermal.c @@ -360,11 +360,8 @@ static int armada_select_channel(struct armada_thermal_priv *priv, int channel) * we must absolutely wait for the sensor validity bit to ensure we read * actual data. */ - if (armada_wait_sensor_validity(priv)) { - dev_err(priv->dev, - "Temperature sensor reading not valid\n"); + if (armada_wait_sensor_validity(priv)) return -EIO; - } return 0; } @@ -402,11 +399,8 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal, int ret; /* Valid check */ - if (!armada_is_valid(priv)) { - dev_err(priv->dev, - "Temperature sensor reading not valid\n"); + if (!armada_is_valid(priv)) return -EIO; - } /* Do the actual reading */ ret = armada_read_sensor(priv, temp); diff --git a/drivers/thermal/broadcom/brcmstb_thermal.c b/drivers/thermal/broadcom/brcmstb_thermal.c index 60173cc83c46..72d1dbe60b8f 100644 --- a/drivers/thermal/broadcom/brcmstb_thermal.c +++ b/drivers/thermal/broadcom/brcmstb_thermal.c @@ -158,10 +158,8 @@ static int brcmstb_get_temp(struct thermal_zone_device *tz, int *temp) val = __raw_readl(priv->tmon_base + AVS_TMON_STATUS); - if (!(val & AVS_TMON_STATUS_valid_msk)) { - dev_err(priv->dev, "reading not valid\n"); + if (!(val & AVS_TMON_STATUS_valid_msk)) return -EIO; - } val = (val & AVS_TMON_STATUS_data_msk) >> AVS_TMON_STATUS_data_shift; diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c index 6db1882e8229..9954040d1d2c 100644 --- a/drivers/thermal/dove_thermal.c +++ b/drivers/thermal/dove_thermal.c @@ -91,11 +91,8 @@ static int dove_get_temp(struct thermal_zone_device *thermal, /* Valid check */ reg = readl_relaxed(priv->control + PMU_TEMP_DIOD_CTRL1_REG); - if ((reg & PMU_TDC1_TEMP_VALID_MASK) == 0x0) { - dev_err(&thermal->device, - "Temperature sensor reading not valid\n"); + if ((reg & PMU_TDC1_TEMP_VALID_MASK) == 0x0) return -EIO; - } /* * Calculate temperature. According to Marvell internal diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index f3a374266fa0..0d135b8a5b62 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -436,9 +436,6 @@ static int hisi_thermal_get_temp(struct thermal_zone_device *tz, int *temp) *temp = data->ops->get_temp(sensor); - dev_dbg(&data->pdev->dev, "tzd=%p, id=%d, temp=%d, thres=%d\n", - sensor->tzd, sensor->id, *temp, sensor->thres_temp); - return 0; } diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c index ddde4bdfc94a..2d7a6bd2846b 100644 --- a/drivers/thermal/imx_sc_thermal.c +++ b/drivers/thermal/imx_sc_thermal.c @@ -58,11 +58,8 @@ static int imx_sc_thermal_get_temp(struct thermal_zone_device *tz, int *temp) hdr->size = 2; ret = imx_scu_call_rpc(thermal_ipc_handle, &msg, true); - if (ret) { - dev_err(&sensor->tzd->device, "read temp sensor %d failed, ret %d\n", - sensor->resource_id, ret); + if (ret) return ret; - } *temp = msg.data.resp.celsius * 1000 + msg.data.resp.tenths * 100; diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index a22b8086a209..a0b8de269986 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -265,10 +265,8 @@ static int imx_get_temp(struct thermal_zone_device *tz, int *temp) regmap_read(map, soc_data->temp_data, &val); - if ((val & soc_data->temp_valid_mask) == 0) { - dev_dbg(&tz->device, "temp measurement never finished\n"); + if ((val & soc_data->temp_valid_mask) == 0) return -EAGAIN; - } n_meas = (val & soc_data->temp_value_mask) >> soc_data->temp_value_shift; diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c index 92b3ce426b9d..668747bd86ef 100644 --- a/drivers/thermal/kirkwood_thermal.c +++ b/drivers/thermal/kirkwood_thermal.c @@ -33,11 +33,8 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal, /* Valid check */ if (!((reg >> KIRKWOOD_THERMAL_VALID_OFFSET) & - KIRKWOOD_THERMAL_VALID_MASK)) { - dev_err(&thermal->device, - "Temperature sensor reading not valid\n"); + KIRKWOOD_THERMAL_VALID_MASK)) return -EIO; - } /* * Calculate temperature. According to Marvell internal diff --git a/drivers/thermal/max77620_thermal.c b/drivers/thermal/max77620_thermal.c index bf1679765f1b..61c7622d9945 100644 --- a/drivers/thermal/max77620_thermal.c +++ b/drivers/thermal/max77620_thermal.c @@ -51,10 +51,8 @@ static int max77620_thermal_read_temp(struct thermal_zone_device *tz, int *temp) int ret; ret = regmap_read(mtherm->rmap, MAX77620_REG_STATLBT, &val); - if (ret < 0) { - dev_err(mtherm->dev, "Failed to read STATLBT: %d\n", ret); + if (ret < 0) return ret; - } if (val & MAX77620_IRQ_TJALRM2_MASK) *temp = MAX77620_TJALARM2_TEMP; diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 8a51eb26e798..71e533df563a 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1233,9 +1233,6 @@ static int rockchip_thermal_get_temp(struct thermal_zone_device *tz, int *out_te retval = tsadc->get_temp(&tsadc->table, sensor->id, thermal->regs, out_temp); - dev_dbg(&thermal->pdev->dev, "sensor %d - temp: %d, retval: %d\n", - sensor->id, *out_temp, retval); - return retval; } diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index 6ed393218eb8..2d3042098445 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -109,7 +109,6 @@ static int st_thermal_calibration(struct st_thermal_sensor *sensor) static int st_thermal_get_temp(struct thermal_zone_device *th, int *temperature) { struct st_thermal_sensor *sensor = thermal_zone_device_priv(th); - struct device *dev = sensor->dev; unsigned int temp; unsigned int overflow; int ret; @@ -127,8 +126,6 @@ static int st_thermal_get_temp(struct thermal_zone_device *th, int *temperature) temp += sensor->cdata->temp_adjust_val; temp = mcelsius(temp); - dev_dbg(dev, "temperature: %d\n", temp); - *temperature = temp; return 0; diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c index 2c283e762d81..017b0ce52122 100644 --- a/drivers/thermal/thermal-generic-adc.c +++ b/drivers/thermal/thermal-generic-adc.c @@ -59,10 +59,9 @@ static int gadc_thermal_get_temp(struct thermal_zone_device *tz, int *temp) int ret; ret = iio_read_channel_processed(gti->channel, &val); - if (ret < 0) { - dev_err(gti->dev, "IIO channel read failed %d\n", ret); + if (ret < 0) return ret; - } + *temp = gadc_thermal_adc_to_temp(gti, val); return 0; From patchwork Tue Feb 28 11:22:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 13154780 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4BAF5C64ED6 for ; Tue, 28 Feb 2023 11:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ucr7J1/mDZW4Ka7nhbrVn8FT0ozr+vRvQLaIZmxxx6c=; b=Tqf5L7BJpPNCDI y86FeAtdy5veLFQjSOFo7nGXafiyuR5m8OvMAb3W9wUH1fP+NHIWAhLctComVyMVf6F5uQZxggblm JUFdxlOMd71Roh6bk6QKVzSQaI1xXtGSDEVycKsaOJ2+1jdLdzf5h9uyvQuEM4r/BW17CgMNDQmfs a10ABUyAT+E8qyqQz4e8hMjrurDZLYeX6+ShDoy/qgVe6LspoKixOki7/vtSBtNmD0UuvdBxQ1Jtg lB6h8yb4/Y04YGnsoOSJ1FvuujvhPdUxzhPgQnd3B3sMaOGdyUZ468STspaTLXXOW72haBUTNLDBr Y79PYOsjVLk2DTCPv77Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWy5H-00CxDx-5j; Tue, 28 Feb 2023 11:23:51 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWy4o-00Cwuz-79 for linux-rockchip@lists.infradead.org; Tue, 28 Feb 2023 11:23:27 +0000 Received: by mail-wm1-x32a.google.com with SMTP id l7-20020a05600c4f0700b003e79fa98ce1so5633880wmq.2 for ; Tue, 28 Feb 2023 03:23:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677583398; 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=l/7e8N8b7gEax6Mp/tnE3jBK1MXlLnukXxRJZ25cEfk=; b=ugP/qb79XHWui7cXoByzxM7H5Ndd6EHD4As17TTDz/sL0vxrreM6S0Rd5mZjO36jhS bkOCyiQBq6LshL55L2+LTtMrsSbvyQL8VFoIy5+OV9OaJw8jw6HilSIlnp+Gn9I8AhP8 PVpBfzKVNC2sDg+aBEiDVs7F277a5MBZff+hEOHwrdOLr6Q1yQJKU4DvzdNkeArp1ra5 0OfptdKpeXlwk6HSTURpPqGYvwrHZIJOaShMYz2MTMQB2BhUcQM8/U/NAnsxFeb8TPaJ e3oAkyn41d2BMaRwTwUsPZUhU+mhjERUjjUTEgkKa/9Vh4xkCtDLkIDACp+pqwpYuch9 nBmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677583398; 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=l/7e8N8b7gEax6Mp/tnE3jBK1MXlLnukXxRJZ25cEfk=; b=GT/UaT78tnRmYZcSdWwz1YjCeysJ4XbmkJMRFfW+RGyVPDSlsJq+UQDykOd2JHHCnd lsjhVE/UQQRhYhYEYrYDA1Nzb+cjGpa42tnYckB9XItaKIgiWW4oEcG636xYNri7c+ez x1TGw1n4nl/OmlF+Jn5LLMnu2eDqrsAFW8lR5FyEbIfaoj3UAkzHYJOh655MEDeWj/Ju 6sZ5OxV2GJ769Uyn+wYT+yl3qvfYz2vVpPLKr4TCHvuj9rw3llmdgAmacjoK6Dp0N2tP zrsjVIUIVLRqsCAU1BR/LMXE/KYqTAqivlSTo0GiqCDi9ct3VHJRvvKb7ecVPygKSuoA 4d7Q== X-Gm-Message-State: AO0yUKUUlS9SmBCYR4lkdzxPjJNNrv+BNmrDmbirm2c9Xbt9lm9qNJFO ThLYC7SeYGMhGe6oLKZCoZlOzQ== X-Google-Smtp-Source: AK7set9c3Ot0db0lPXGiqEvJ1x9YekQ9o8QVG2P5/jvd8AyEHv4NMlOKqer91eZV2Kw1LxNyKaYIDw== X-Received: by 2002:a05:600c:19d4:b0:3e1:bfc:d16e with SMTP id u20-20020a05600c19d400b003e10bfcd16emr1866787wmq.39.1677583398360; Tue, 28 Feb 2023 03:23:18 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6830:6390:2815:b6a5]) by smtp.gmail.com with ESMTPSA id z5-20020a5d6545000000b002c5501a5803sm9598130wrv.65.2023.02.28.03.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 03:23:17 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Niklas?= =?utf-8?q?_S=C3=B6derlund?= , Florian Fainelli , Amit Kucheria , Zhang Rui , Broadcom internal kernel review list , Ray Jui , Scott Branden , =?utf-8?q?Niklas_S=C3=B6derlund?= , Heiko Stuebner , Mark Brown , AngeloGioacchino Del Regno , Stefan Wahren , Baolin Wang , ye xingchen , linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE), linux-renesas-soc@vger.kernel.org (open list:RENESAS R-CAR THERMAL DRIVERS), linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC support) Subject: [PATCH v4 07/19] thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs() Date: Tue, 28 Feb 2023 12:22:26 +0100 Message-Id: <20230228112238.2312273-8-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230228112238.2312273-1-daniel.lezcano@linaro.org> References: <20230228112238.2312273-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230228_032322_288996_237B514D X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The thermal->tzp->no_hwmon parameter is only used when calling thermal_zone_device_register(). Setting it to 'false' before calling thermal_add_hwmon_sysfs() has no effect. Remove the call and again prevent the drivers to access the thermal internals. Reviewed-by: Niklas Söderlund #R-Car Signed-off-by: Daniel Lezcano Acked-by: Florian Fainelli #Broadcom --- drivers/thermal/broadcom/bcm2711_thermal.c | 1 - drivers/thermal/broadcom/bcm2835_thermal.c | 1 - drivers/thermal/rcar_gen3_thermal.c | 1 - drivers/thermal/rcar_thermal.c | 5 ----- drivers/thermal/rockchip_thermal.c | 1 - drivers/thermal/rzg2l_thermal.c | 1 - 6 files changed, 10 deletions(-) diff --git a/drivers/thermal/broadcom/bcm2711_thermal.c b/drivers/thermal/broadcom/bcm2711_thermal.c index fcfcbbf044a4..c243a76a3471 100644 --- a/drivers/thermal/broadcom/bcm2711_thermal.c +++ b/drivers/thermal/broadcom/bcm2711_thermal.c @@ -98,7 +98,6 @@ static int bcm2711_thermal_probe(struct platform_device *pdev) priv->thermal = thermal; - thermal->tzp->no_hwmon = false; return thermal_add_hwmon_sysfs(thermal); } diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c index 86aaf459de37..a217d832f24e 100644 --- a/drivers/thermal/broadcom/bcm2835_thermal.c +++ b/drivers/thermal/broadcom/bcm2835_thermal.c @@ -267,7 +267,6 @@ static int bcm2835_thermal_probe(struct platform_device *pdev) * Thermal_zone doesn't enable hwmon as default, * enable it here */ - tz->tzp->no_hwmon = false; err = thermal_add_hwmon_sysfs(tz); if (err) goto err_tz; diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 2b7537ef141d..3df00c9d55ab 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -527,7 +527,6 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) } tsc->zone = zone; - tsc->zone->tzp->no_hwmon = false; ret = thermal_add_hwmon_sysfs(tsc->zone); if (ret) goto error_unregister; diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index e0440f63ae77..b8571f7090aa 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -509,11 +509,6 @@ static int rcar_thermal_probe(struct platform_device *pdev) } if (chip->use_of_thermal) { - /* - * thermal_zone doesn't enable hwmon as default, - * but, enable it here to keep compatible - */ - priv->zone->tzp->no_hwmon = false; ret = thermal_add_hwmon_sysfs(priv->zone); if (ret) goto error_unregister; diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 71e533df563a..bb254bdff043 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -1451,7 +1451,6 @@ static int rockchip_thermal_probe(struct platform_device *pdev) for (i = 0; i < thermal->chip->chn_num; i++) { rockchip_thermal_toggle_sensor(&thermal->sensors[i], true); - thermal->sensors[i].tzd->tzp->no_hwmon = false; error = thermal_add_hwmon_sysfs(thermal->sensors[i].tzd); if (error) dev_warn(&pdev->dev, diff --git a/drivers/thermal/rzg2l_thermal.c b/drivers/thermal/rzg2l_thermal.c index 7631430ce8a9..b56981f85306 100644 --- a/drivers/thermal/rzg2l_thermal.c +++ b/drivers/thermal/rzg2l_thermal.c @@ -216,7 +216,6 @@ static int rzg2l_thermal_probe(struct platform_device *pdev) } priv->zone = zone; - priv->zone->tzp->no_hwmon = false; ret = thermal_add_hwmon_sysfs(priv->zone); if (ret) goto err;