From patchwork Sun Feb 26 22:53:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 61674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2131116wrd; Sun, 26 Feb 2023 14:56:15 -0800 (PST) X-Google-Smtp-Source: AK7set8O+FYiq5LFN6/4+5FhjGN/osUj6E6cGT+bMa4kTfsdij9WTlg8spSoQIX98tSstyS0ixsJ X-Received: by 2002:a17:902:ab57:b0:19a:839d:b67a with SMTP id ij23-20020a170902ab5700b0019a839db67amr24373691plb.5.1677452175523; Sun, 26 Feb 2023 14:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677452175; cv=none; d=google.com; s=arc-20160816; b=ubmrYpbg8mjPteP/IysuGCzQ2X03Lo3BQdQ1e7Da91Zl8FQwW/c0gXf9MCXxTuhmzi 3xH7ej0YknJvInh4Us3R1ujO2DA+iKTJTyEq/u6Kv6fHuHRPxkWahpLCP+4tq1Ac0ZvS 5DnaK4n7edAMHsXsFJOUrskHZzMRSxDLxc7r82sZeWavchdShy6KRdMpHWoM3HcgFWQF XviZmNIAJD18W1JUjf6SQt+hV9zOnb9llB+2ftPXdy/kb35BrE22D6A5fDgaQLnUHAeT Bk80TE1oit38IOS2V2lo2hzSX/BueEOHQORiX1qdgNvtZjc/ob5K4AXPmXZLeHBP0HZQ +A1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l/7e8N8b7gEax6Mp/tnE3jBK1MXlLnukXxRJZ25cEfk=; b=GN+M5RFM2X0rjSTf3ws+kVDcIk+aoWQ46IFydoJmTHGTHwtuNYmokrXMjTN9eIPo8K ePK4j4T/sPlXOLOb84OmhwQRaSHRVsmzAwpU52FffOFlxPWc3JB2ddP7U0rt2cKl4FXY CkX9+1S4vqHDR7kuu74/OgPoY94q1waJ/LlwShmawwnnLPbRtrXIjgtB7U/A3e7piGrV wx9vlozsLOP4fVjT5L1SgPp4gYc40zyw2PMpMWoiixiAkwUHVVsKbesiHN09QX9YUeYU k8vr24Cv7m31/aQBVsepKDnzsAIOvtZk9a3QfcHAYeneiLDWrxatV1wKOsiepofAYOeD eVIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LV1q16a8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a170902788600b0017a0e7aaf6bsi5662685pll.128.2023.02.26.14.56.02; Sun, 26 Feb 2023 14:56:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LV1q16a8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229762AbjBZWzm (ORCPT + 99 others); Sun, 26 Feb 2023 17:55:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbjBZWzR (ORCPT ); Sun, 26 Feb 2023 17:55:17 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6A2BC15C for ; Sun, 26 Feb 2023 14:54:55 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id o11-20020a05600c4fcb00b003eb33ea29a8so2284431wmq.1 for ; Sun, 26 Feb 2023 14:54:55 -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=l/7e8N8b7gEax6Mp/tnE3jBK1MXlLnukXxRJZ25cEfk=; b=LV1q16a8ufrWjrmUJWYiSM4vEBzFe69sHVoWSyIy6D8gP9rVoeaZ8SGGg4yMAwhBuf sC3dmJ92HjERa9/xr/Npl0xlO/JnqfdENLQ6LoHuJxWUxuXf+vQEHug3HSgqaSrA1l/v tZ3yPw9HmNxE0Vjn3QCZ+tTAETRcV0qpdurISi9lJAMaBJ/JJC7bxTEeffYmaNI0sVvU MxQ5jxSuO4kgZbC0JhwKprVOU6jtjcopKJBF4OODGpcPO2ERLidTZnlyiWV1vDIZ9+Km IhrWVvwE0drF0YPzEg23GNQI8/y76u8qGdPeuTCht9kuLqmNdjo6vr8z7+5pcqawQ7zv rbOA== 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=l/7e8N8b7gEax6Mp/tnE3jBK1MXlLnukXxRJZ25cEfk=; b=yLG1pySs8wGjLt3tklw8I7mqzYvxO86q7+NNHE3sExyFawAQ2/o+XVf+D9Co6NsPi7 kvgsErPLQW879CSpRYTMp+ExPrXvnqMMysCj4MMighAKZ3WY56i6OJnpmOTwAAfGQ0pm d9HGNfFWXzLaLPSe8R9AQmA39yyH9lcWTIqMDTGIVQ7M0QA0kIrttO8EDi7UgrWeMJm3 ctHBCwpB17CnWqMdIOePXnqsF/nNLydiMpclTy3Xb4sBWILlA6sA2PBf5Pi14M5OpTwj xYgmp0F45kRu6ia+ezGtaRHBgyZHkQxBbGUtC3HLbNR+UxU81GofYrmNn0qXesYuR9Kk F40A== X-Gm-Message-State: AO0yUKWEbhv9p7Ngzv9ND8V8NO+uDtDXTHCcinP4YPKaGhAvW0xmVdrL wunwyFJz31QqznQOMfEARJeJIw== X-Received: by 2002:a05:600c:a692:b0:3db:2858:db84 with SMTP id ip18-20020a05600ca69200b003db2858db84mr17311911wmb.34.1677452095318; Sun, 26 Feb 2023 14:54:55 -0800 (PST) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:8baa:6b32:391b:62de]) by smtp.gmail.com with ESMTPSA id d10-20020a05600c3aca00b003eb369abd92sm6138074wms.2.2023.02.26.14.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 14:54:54 -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 , Jernej Skrabec , Mark Brown , Stefan Wahren , Balsam CHIHI , Adam Ward , 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 v3 07/20] thermal/hwmon: Do not set no_hwmon before calling thermal_add_hwmon_sysfs() Date: Sun, 26 Feb 2023 23:53:53 +0100 Message-Id: <20230226225406.979703-8-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230226225406.979703-1-daniel.lezcano@linaro.org> References: <20230226225406.979703-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758936092608717149?= X-GMAIL-MSGID: =?utf-8?q?1758936092608717149?= 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;