From patchwork Thu Apr 13 11:46:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 673065 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 79CDAC77B61 for ; Thu, 13 Apr 2023 11:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbjDMLq7 (ORCPT ); Thu, 13 Apr 2023 07:46:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230173AbjDMLq6 (ORCPT ); Thu, 13 Apr 2023 07:46:58 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D717F9EC2 for ; Thu, 13 Apr 2023 04:46:54 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id n19-20020a05600c501300b003f064936c3eso12916831wmr.0 for ; Thu, 13 Apr 2023 04:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386413; x=1683978413; 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=qMszukETqZzqN2APgbL3HkGY76Y4/3+HTAH7iHHTbjs=; b=fDLj+JhZmQaUGryXvgdjQCNDXdoqFgTkTrHXpJgBrIO+p8SEHrKWCOHuePGBH6lck4 paIoa1H/oXCczGAfsP8VvFRSCqEEwb3SwOT9gSeMAo+2byYd9eNfTJfBrEk83D7kbqPc f1vscaOxgXDndIy4Npotz5zwdqKJpzFKkww2+i5LWp4m3hamd24pZgzN0laa/kQVt9l+ cerLSDekVJlHYWVHFsGIl2xLZ8P1GQEU/itW2/OwhgGEb29RJkiJSOakmy9bB4Wz2TbO ntOebgJ8AM22I6IzdstG5HmQWIwc4RLxHlyPTWJvLcYfmhSBpLIPmueQyxoYxnwnKXQz tdhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386413; x=1683978413; 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=qMszukETqZzqN2APgbL3HkGY76Y4/3+HTAH7iHHTbjs=; b=Y/+R6lbjUSuKJFFwK+UyAvkfk1R8EhdyFHGz0T7ZIIdQofVsC9kwabd4gDmMxUd3Bb xa13BNZfNFIo97oTZGNYvnM3ezLS40hC2QreJHPgoD+RXsH3EAN4HwUQKxKkwMRTQ9X7 nJrZZGcnDjcHjx9G4gkq9dLvtsVjVG98oG+ztUu5XdVVZiRlkaZvKzuB+fcOsNC1E2iL 7q2lDYYcCLZ4rcaz7G/GeASwxr562BRUEeSDv+l+MEcstz5/O3rSly/Zm1elcnJJ26j7 a1pwCOB/6Y91yJdPiT9gbNOs8Ek8pCUr+8F3cOtvizYTm+hGYa127g+552I0rsW7cOtV Vdxw== X-Gm-Message-State: AAQBX9fN1NkL3uCyGiFPTO4UYkLNX/NXTNM8F6uPGsIrM9zRKIH1n0h8 kCPOorRGc6wTmKtSfWhuTtXdkzvAnaeL+HQn6TI= X-Google-Smtp-Source: AKy350anACfJBHQh2ByzrA7WOF3l20/Yr3nEHUhgh97H5ghL2sDsePIl7V7m9RXXj6uMY8O9qq+XKw== X-Received: by 2002:a7b:ca4c:0:b0:3f0:7147:2ecd with SMTP id m12-20020a7bca4c000000b003f071472ecdmr1626553wml.7.1681386413209; Thu, 13 Apr 2023 04:46:53 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:52 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria Subject: [PATCH v3 1/6] thermal/core: Encapsulate tz->device field Date: Thu, 13 Apr 2023 13:46:42 +0200 Message-Id: <20230413114647.3878792-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org There are still some drivers needing to play with the thermal zone device internals. That is not the best but until we can figure out if the information is really needed, let's encapsulate the field used in the thermal zone device structure, so we can move forward relocating the thermal zone device structure definition in the thermal framework private headers. Some drivers are accessing tz->device, that implies they need to have the knowledge of the thermal_zone_device structure but we want to self-encapsulate this structure and reduce the scope of the structure to the thermal core only. By adding this wrapper, these drivers won't need the thermal zone device structure definition and are no longer an obstacle to its relocation to the private thermal core headers. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 6 ++++++ include/linux/thermal.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index c5025aca22ee..842f678c1c3e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1398,6 +1398,12 @@ int thermal_zone_device_id(struct thermal_zone_device *tzd) } EXPORT_SYMBOL_GPL(thermal_zone_device_id); +struct device *thermal_zone_device(struct thermal_zone_device *tzd) +{ + return &tzd->device; +} +EXPORT_SYMBOL_GPL(thermal_zone_device); + /** * thermal_zone_device_unregister - removes the registered thermal zone device * @tz: the thermal zone device to remove diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 82ddb32f9876..87837094d549 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -313,6 +313,7 @@ thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int void *thermal_zone_device_priv(struct thermal_zone_device *tzd); const char *thermal_zone_device_type(struct thermal_zone_device *tzd); int thermal_zone_device_id(struct thermal_zone_device *tzd); +struct device *thermal_zone_device(struct thermal_zone_device *tzd); int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, struct thermal_cooling_device *, From patchwork Thu Apr 13 11:46:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 673064 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 F0C3BC77B76 for ; Thu, 13 Apr 2023 11:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbjDMLrA (ORCPT ); Thu, 13 Apr 2023 07:47:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjDMLq7 (ORCPT ); Thu, 13 Apr 2023 07:46:59 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648552729 for ; Thu, 13 Apr 2023 04:46:56 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id o6-20020a05600c4fc600b003ef6e6754c5so5992586wmq.5 for ; Thu, 13 Apr 2023 04:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386415; x=1683978415; 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=3AD5Mv81x1OfSGYx8Typ89SsCtnJrhePS3JykvPhl6k=; b=R+IWqIXQjMrTORnXHQ/dbbWc/32x3W0LfqaNkiqXhr0Wti8JO4WnUrnFok8jp0nLsd OjkTjLPKbFSnra9XHlHWb1vLwnzPrxgk0kIoI97S35LTdHFD2zLLISaWc5B43q3T+QRe PkWCFNR4YpOTAUA4GRrw2BPL6A/YnWefg4uhb9s4ukBh5jpsKaUxVltnaE90lrnl6/bH nCeD7nb6MkKcxry5iir+1zIlXK6zw4V+SfBEm2DOvBRpYamqaSOy+Sq/0qxWs+BQKbxR 7hBPYVEpTI2ueafA/Gs2hqipcOrp9WIroOdpzuvRx8OucrA2Fi2xBa9MkhjHaN4cr+iw DKQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386415; x=1683978415; 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=3AD5Mv81x1OfSGYx8Typ89SsCtnJrhePS3JykvPhl6k=; b=SFRD/wutHJJFMSET0EjG7CBiwedMo93/rKMymHecILWbjr2F1SdZP7HsJM00M17k4G BcAOMKkpYHis+nLe3hbhQTLm5LEopJHFfW350NOz4IHdKCshXJnyuWItnrTaHun+scfj dlhf/yql7JSQmoQ997/1kZ0ba1cbAtTm94QX58DO8Vjv+pwLyGngVEiOwzFdAD7tKuyB iXAxEtNp0KYEe51WccBIDGjVnLWBStCjggHkFUAOJgcRZxPZWVyt4VAbypccSMiiYfnA czYNA0fdgePeTljB60D9vnwYD8ptH8tSJBpNcTxEwPlyORu+NkgQmTJMtPZukiLpv1H/ EUzQ== X-Gm-Message-State: AAQBX9ebRJn/Ob43QjMMfLHEquqgpn21c9zp7rrpIL/+N6GgZ1Aa8kBs x+0A0FGp+H3W+S3uNI5nr1CWyw== X-Google-Smtp-Source: AKy350aOOadYVPk63yq/w3nSCo+Rg2v8bVsrk3UMItD3+T8OjNao8Q+lCMMWTIvNuR+9JpAZ3dYy0Q== X-Received: by 2002:a05:600c:c5:b0:3ed:8780:f265 with SMTP id u5-20020a05600c00c500b003ed8780f265mr1519565wmm.21.1681386414778; Thu, 13 Apr 2023 04:46:54 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:54 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Heiko Stuebner , Kunihiko Hayashi , Tim Zimmermann Subject: [PATCH v3 2/6] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace Date: Thu, 13 Apr 2023 13:46:43 +0200 Message-Id: <20230413114647.3878792-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The pch_critical() callback accesses the thermal zone device structure internals, it dereferences the thermal zone struct device and the 'type'. Use the available accessors instead of accessing the structure directly. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/intel_pch_thermal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c index dce50d239357..b3905e34c507 100644 --- a/drivers/thermal/intel/intel_pch_thermal.c +++ b/drivers/thermal/intel/intel_pch_thermal.c @@ -127,7 +127,8 @@ static int pch_thermal_get_temp(struct thermal_zone_device *tzd, int *temp) static void pch_critical(struct thermal_zone_device *tzd) { - dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type); + dev_dbg(thermal_zone_device(tzd), "%s: critical temperature reached\n", + thermal_zone_device_type(tzd)); } static struct thermal_zone_device_ops tzd_ops = { From patchwork Thu Apr 13 11:46:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 673063 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 88CA4C77B6E for ; Thu, 13 Apr 2023 11:47:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230213AbjDMLrF (ORCPT ); Thu, 13 Apr 2023 07:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230382AbjDMLrC (ORCPT ); Thu, 13 Apr 2023 07:47:02 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 183489ED6 for ; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id j15so199008wrb.11 for ; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386416; x=1683978416; 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=jPfklvntaSAZNSstWZb9c9xIuh7wy5gv7laC1WOc6HM=; b=mDbWDIMrs80Dg1X3n8qgHhFGUOe6N65/cxnaPkXu8L/u0v2gXFy4o5AYBOPULELYrf EIiwVZSyOUpakBCyW+PfJfDJRoIrIL2F6ljEw7xeELo5D7NHqckJy5HFn3qcalkjGpwz sXwV6Wrx03D6MMqcJyOE4kpFdXoIv55w1u0+MmI3TOfc6Fz1DgDs6HLtH9D5LWy24M/M iPRCZdLZx0SW20t1P+QRyt3eMRDLMxcnNk6s8lzavrgwyTWeFgrC1R1kdK6WIsB9pY2z ro/Opp0IWV4twEI73qiVgQOCbcht/Rv0tykmsjSP8GlMz691Wf6L//VRJO0+pJfrysgB rXBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386416; x=1683978416; 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=jPfklvntaSAZNSstWZb9c9xIuh7wy5gv7laC1WOc6HM=; b=L7roI8o2vJPWj72yb73bOwU5L/QePd9PrQ0Qmfwx6yPZjOzC12MiNW4n/Wy7+u11H2 Q+xFJeLMUCT+uaq+U26tTdu2gcv1mM/mjvWFaq5Asj3FSIFahPBbNoyh5WnWmObL2Hfr IpjojlQz1I++oJELxilG9C5WgQBJJ9Hdn2sbBZwCBt1nsYsdQawE1XFWN73ogNlolcdg Do9AM+rAuXFf4mAqWZNSZZ1SIKuOl464L8YLRIM1CE1QdzqatXI8mkWYug7SmErG1QFx ZxIEGgo7C9uoF92YInmRbrLZyYjW0JVupuuz/DQVj2yNg4FSjo4xkjYh/WgFC8AE5+My lN9w== X-Gm-Message-State: AAQBX9dIaFQf7qRjChadLNhKu4X63mPw2apFCuaTnG2aFb23YURTQP4k OC19eUH57vGpuMY54ElATj55+g== X-Google-Smtp-Source: AKy350YoZHt4D4EMrgZOQ9wXahuXlD/QN0ullKssM3+oVI64zUdHVMOgcxKjDjSNsfBySge+BjF4yw== X-Received: by 2002:adf:dc45:0:b0:2f6:44fb:a7f2 with SMTP id m5-20020adfdc45000000b002f644fba7f2mr625230wrj.24.1681386416496; Thu, 13 Apr 2023 04:46:56 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:56 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Sujith Thomas , Amit Kucheria Subject: [PATCH v3 4/6] thermal/drivers/menlow: Use thermal_zone_device() Date: Thu, 13 Apr 2023 13:46:45 +0200 Message-Id: <20230413114647.3878792-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org In order to get the device associated with the thermal zone, let's use the wrapper thermal_zone_device() instead of accessing directly the content of the thermal zone device structure. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/intel_menlow.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/intel/intel_menlow.c b/drivers/thermal/intel/intel_menlow.c index 5a6ad0552311..d720add918ff 100644 --- a/drivers/thermal/intel/intel_menlow.c +++ b/drivers/thermal/intel/intel_menlow.c @@ -422,7 +422,8 @@ static acpi_status intel_menlow_register_sensor(acpi_handle handle, u32 lvl, result = intel_menlow_add_one_attribute("aux0", 0644, aux0_show, aux0_store, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) return AE_ERROR; @@ -436,7 +437,8 @@ static acpi_status intel_menlow_register_sensor(acpi_handle handle, u32 lvl, result = intel_menlow_add_one_attribute("aux1", 0644, aux1_show, aux1_store, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) { intel_menlow_unregister_sensor(); return AE_ERROR; @@ -449,7 +451,8 @@ static acpi_status intel_menlow_register_sensor(acpi_handle handle, u32 lvl, result = intel_menlow_add_one_attribute("bios_enabled", 0444, bios_enabled_show, NULL, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) { intel_menlow_unregister_sensor(); return AE_ERROR; From patchwork Thu Apr 13 11:46:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 673062 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 065C7C77B76 for ; Thu, 13 Apr 2023 11:47:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbjDMLrQ (ORCPT ); Thu, 13 Apr 2023 07:47:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbjDMLrO (ORCPT ); Thu, 13 Apr 2023 07:47:14 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A569E9771 for ; Thu, 13 Apr 2023 04:47:00 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id k36-20020a05600c1ca400b003f0a7c483feso914313wms.4 for ; Thu, 13 Apr 2023 04:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681386419; x=1683978419; 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=kgd1bKrI7tjr//X7ubfNjfbEbuKleNxuvfM0dDIe1Gc=; b=fOZw2vqXmpMsIvnANbpE6Yf0UWMjh2+up+0Wd8okyz6mfc2Bl9M7WildNt1NGyW0JT qSPskNbOIEslrEeROi/kg/eh7FGlagAmjJmCor9ZbZ/wkzTEvAKJGJ0tI1k9/TmkoXSH he/jtW3euAItBayzBXMvBhuIpd4/HQ+9d9AH4QbTbjT+jWq4Z4TcydkuOjps/4yDFZuE eJmAlbo6cEFE0H2ob+b6ftMp4lbR6F49Whzq+vvW5O83Fi6h2HKb5bcHGFYuIqi70vhP 0Afg4Z2E8+JYUCLS2UX6DibdUYyLZKG6OPrvoHxNvSiE083G3lxsVDmGb+J7c4eaWH1G 03KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681386419; x=1683978419; 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=kgd1bKrI7tjr//X7ubfNjfbEbuKleNxuvfM0dDIe1Gc=; b=BfdTguMGBlBJzJEnOfiOtICT5rWsWohXnVl5PinMFXpZphU77FDopv0EiMi8KfpYM8 WAXxNwmlYOLiKyLo8FSuAHRxHXrljKYeSiPu3sZrJNZJzN0i1oX1g6LsUiwlw6o6jhb4 /Pepo87HQCK58n9WLpxbLy4dD3CALDQYV+WOyftLrhB8EEorBGWulW6XSX00dvLQayTG HXzctjJtSEkFRM/C3ELkzSRcPiXpIoAP2nxPkNzmst0uOeCROJwHstSyTakmN9n0oGuf IXIJ/5tTikYsmTF7idToJXRiXeDC4CwLGqZ8rILMzKF5BEyhzP/bzDvMq0+0NsOCFmqr 2GKg== X-Gm-Message-State: AAQBX9fJE6eOnNmUvF66SJyYcTkiHCnIWNse5ZJxQW4S8VVX6ptKDEYJ bgSBnwN+//AFIAnulFb55HBVMw== X-Google-Smtp-Source: AKy350bTPiuIJ0i8zSXeUqnj7IbwFV93lyOjz6TbBVxB+THSMry1udKD8Mb5YuFclDDP83+MpZkaFA== X-Received: by 2002:a7b:c8c7:0:b0:3ed:301c:375c with SMTP id f7-20020a7bc8c7000000b003ed301c375cmr1532709wml.21.1681386418943; Thu, 13 Apr 2023 04:46:58 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:6418:c878:b0e:d11b]) by smtp.gmail.com with ESMTPSA id iz11-20020a05600c554b00b003f09aaf547asm6730590wmb.1.2023.04.13.04.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Apr 2023 04:46:58 -0700 (PDT) From: Daniel Lezcano To: daniel.lezcano@linaro.org, rafael@kernel.org Cc: rui.zhang@intel.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Amit Kucheria , Sujith Thomas , Srinivas Pandruvada , Randy Dunlap Subject: [PATCH v3 6/6] thermal/drivers/intel_menlow: Make additionnal sysfs information optional Date: Thu, 13 Apr 2023 13:46:47 +0200 Message-Id: <20230413114647.3878792-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230413114647.3878792-1-daniel.lezcano@linaro.org> References: <20230413114647.3878792-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The Menlon thermal driver creates specific files in the thermal zone sysfs class. It is specific to Menlon and these entries look debug code. It is probable these are not needed. Let's make the code optional and disable it by default. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/Kconfig | 11 +++++++++++ drivers/thermal/intel/intel_menlow.c | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig index cb7e7697cf1e..1405d9cd2bab 100644 --- a/drivers/thermal/intel/Kconfig +++ b/drivers/thermal/intel/Kconfig @@ -112,6 +112,17 @@ config INTEL_MENLOW If unsure, say N. +config INTEL_MENLOW_SYSFS_ADDON + bool "Enable thermal sysfs addon" + depends on INTEL_MENLOW + def_bool n + help + Enable sysfs extra information added in the thermal + zone. This is specific to this driver. By default those are + disabled and are candidate for removal, if you need these + information anyway, enable the option or upgrade the + userspace program using them. + config INTEL_HFI_THERMAL bool "Intel Hardware Feedback Interface" depends on NET diff --git a/drivers/thermal/intel/intel_menlow.c b/drivers/thermal/intel/intel_menlow.c index d720add918ff..a169d7e4f537 100644 --- a/drivers/thermal/intel/intel_menlow.c +++ b/drivers/thermal/intel/intel_menlow.c @@ -374,6 +374,9 @@ static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *show, struct intel_menlow_attribute *attr; int result; + if (!IS_ENABLED(CONFIG_INTEL_MENLOW_SYSFS_ADDON)) + return 0; + attr = kzalloc(sizeof(struct intel_menlow_attribute), GFP_KERNEL); if (!attr) return -ENOMEM;