From nobody Tue Dec 16 11:49:24 2025 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 3E7B9C6FD18 for ; Wed, 19 Apr 2023 08:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232645AbjDSId7 (ORCPT ); Wed, 19 Apr 2023 04:33:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232632AbjDSId4 (ORCPT ); Wed, 19 Apr 2023 04:33:56 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36A98A5D5 for ; Wed, 19 Apr 2023 01:33:50 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id o29-20020a05600c511d00b003f1739de43cso1007434wms.4 for ; Wed, 19 Apr 2023 01:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893228; x=1684485228; 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=fNZBgi5/L3NSZbebaISkqutxQT/xaM4SeSQXMJbnPyvV/yxFlknwejRTPL/+W3vMHN Ts+vcb++sTq5LlGQy+2K0KouVsNq87U5HlHH2CTUEwXoGBmgei3wKuwoe5YEsWWI90Yc 5geInkDOs9Yg6o9c/ATkbwFS9GWM2/OaCjNXD3cTLRP8HE6+0EPLdoKkHMNDGCTmpdo4 FbVTrAeX3+KiTZ8FapxG7SPn1UAK4Ig7xgGTSnTqUJdgP4rLNlD4h8/pbShZfsYFX+sq yPrVAP9PfOXRYimayZIq4+58i5pWqdnDYbGEKRdj8WYbTjACr2ef41PswIzTWqEcTPRR HPww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893228; x=1684485228; 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=H6iWjibqBjbtZYsk7Z2YGO3pi9+7Qp8iw1VJs8mErJ68+/USuDBJBPFw8z6AsR9+dl 8GHuzicbIOUV/n9tdBovrDpLnBOiIc3m0hBw+mhSXN3Lq33xhpVHOtsdfvvy7NuKxp3P kgjjZhMxmUiW6iw4VeKVWCPYEFnPphTp08JKCF6HDpzDA49ZqwC+0oJvdEtBJIaTvoof 0e391Skaaj6UFcqi4mLv/te1XWAPHLh6Vq35Fat7zOBG6gJSGJ2KeJUVpt5ovkitsBNO T8c4kJziPelcP234tMJV+hdwYzRT4sgV1O0ijnwRwbKULkLNYiIj3lMfpcTbPZHla16/ Zzrw== X-Gm-Message-State: AAQBX9eiRsD8Jm/HCZO/pn5b+60Ax2Hjp94/RUF/wlbkJ6eKf1rOYP8E OwCEuRraGivKphBQtsaUCB6LJw== X-Google-Smtp-Source: AKy350aeTvxrVBN4wqb36Ek3mmEth8i47hzKwiDTK0PVlfOxRZIQFDS7D1tHtEb4wmu9rc/CsKT74w== X-Received: by 2002:a7b:ce97:0:b0:3f1:6fea:790a with SMTP id q23-20020a7bce97000000b003f16fea790amr8789096wmj.30.1681893228584; Wed, 19 Apr 2023 01:33:48 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33:48 -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 v4 1/6] thermal/core: Encapsulate tz->device field Date: Wed, 19 Apr 2023 10:33:38 +0200 Message-Id: <20230419083343.505780-2-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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_devic= e *tzd) } EXPORT_SYMBOL_GPL(thermal_zone_device_id); =20 +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 de= vice * @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 *, s= truct 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); =20 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, struct thermal_cooling_device *, --=20 2.34.1 From nobody Tue Dec 16 11:49:24 2025 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 9F1AFC6FD18 for ; Wed, 19 Apr 2023 08:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232667AbjDSIeD (ORCPT ); Wed, 19 Apr 2023 04:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232646AbjDSId7 (ORCPT ); Wed, 19 Apr 2023 04:33:59 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C62EB6A42 for ; Wed, 19 Apr 2023 01:33:51 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id v3so3654580wml.0 for ; Wed, 19 Apr 2023 01:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893230; x=1684485230; 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=U1lPcV5heSygJ9ofWDeYojMVM95A+UuxL4ofk2x1ddaWC9Kj08sZlocP26Z78XqGzc fR3RK8uuFdQxxxb9muwhb/ZGMXblcIcZnOciZUhO5/P6g/EKCInzFLax4Wf/OQZc/h6d fKCjA8JpxGA0LwnDv2+vd5S17rpL1fCsNRAZc5yTZ2klDJUk6SUB0b8mlWSLk9teEMN2 aoAsio/MzzgtWW+XasJJg/bOlCfIzRlbNWq6iUbodgAn2/1LArJnjC0c3C0nwCtWHB9g Q1XfK6L9EzupyDvj8UPWBtluCKNUWBlEzfpViqBaPvjCd2w61J1cyGx4fWEc5r1IhX/N P16A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893230; x=1684485230; 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=Be2jsJRYCxLy704NrKizPjF9tzyu4t5IVpDLTEw6zQmAwoQJKTkMcTZVH18xXjWVXF 3ouH1SPu/xMYGM7mcGsAeeSkqryxlJZcpxnHysQWCGMxGLQhFZzYsgD8ODd0yPO9AB+l IPdw759naGTuzAGScK2Ylq/UF1rqQ24nW3wokehA+E1pIN1wiYzZLZtV4Wx34syZhSIO fGqD15W6/Ea4UL+xr9ZPT1Wz5COE46iiwKHlnLVXmnTof0nxarmI/Wav7Y3C9Ej53oEH O8YFGj3r3LVDYCo3WLkny1nSgkGOyv9L0iScY/MyD/xwVkOQF7UjwOt+mcVk5tQNy1yO XsiQ== X-Gm-Message-State: AAQBX9d93+5UpglNhA3UOcFIZZFRXiNdnziJJmtpqTr3QbzsKeDj6nwf OBa4k94295hsBmNcK5vqbOjSUw== X-Google-Smtp-Source: AKy350YLyeo8OtAXmyOcq9W+8fi63dp6387Bt1EC39fTL+s5ACJ9IyXM+qJSlsGGkBjLMoeN9poGOA== X-Received: by 2002:a7b:c8d0:0:b0:3f1:6eaf:daa7 with SMTP id f16-20020a7bc8d0000000b003f16eafdaa7mr10106422wml.10.1681893230103; Wed, 19 Apr 2023 01:33:50 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33:49 -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 , Tim Zimmermann , Baolin Wang Subject: [PATCH v4 2/6] thermal/drivers/intel_pch_thermal: Use thermal driver device to write a trace Date: Wed, 19 Apr 2023 10:33:39 +0200 Message-Id: <20230419083343.505780-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/in= tel/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_dev= ice *tzd, int *temp) =20 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)); } =20 static struct thermal_zone_device_ops tzd_ops =3D { --=20 2.34.1 From nobody Tue Dec 16 11:49:24 2025 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 53406C77B73 for ; Wed, 19 Apr 2023 08:34:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232705AbjDSIeP (ORCPT ); Wed, 19 Apr 2023 04:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232676AbjDSIeF (ORCPT ); Wed, 19 Apr 2023 04:34:05 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4794B451 for ; Wed, 19 Apr 2023 01:33:52 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id bi21-20020a05600c3d9500b003f17a8eaedbso1039464wmb.1 for ; Wed, 19 Apr 2023 01:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893231; x=1684485231; 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=+VZk/Xuf/BecNwwdsFB/838vQVCvaje2TQnFopmd7IM=; b=kqvD1wS2ErlZOZ6LzMudKMXG1HyAcYSdSjNuc9Q7/X77eZsJZrqSJ9UTIYC9BrbQL+ 16yHHMVnkp4q/IDBDhzxYxKbnMXKDx4ozH0u/Zp7yZ2JJFcG8v49cejsci+mpqcqm6rc oUfIKrC9B94LztB3abF0hG2JCwhek+fpVUQkQhzjrY1BHQ+2De9Vlo7S1xlGn1/4b/R4 zO7nIKc5swbfbIY0fEZleTCRfWe9oYsHQnihzI+wZcAGaHu6wUwLIoYZ9sqWjobfWSre g+mROweYTMthRhMT47bU3t66balndfeg2Aibs0WdAPgf86TN6bFCHBsr0qyVHobCKMjB zkXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893231; x=1684485231; 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=+VZk/Xuf/BecNwwdsFB/838vQVCvaje2TQnFopmd7IM=; b=OFNVP7vPJIWp/z0tsaba5JNVuZ2XXi5DpNdzxAS8LSQkBarUFIMgbInhrbDQ2OrRXY CvDVXkZdVPfOY7o6dwd30bzprUvgTvOah0DLMRQ4Ae0UZce/UXkoUKGRuA9bTPDCa3di JkbqT0O5uNGIngpIO487E+9nDyLRww8sgNmkDH6zVSTIIjBseffh2Uun7mf3ccZYNY+t cdieU76hdVrpn2UI5EQDdt0fL3YKBNQ6wEZ77Uu+A0uewT+uv1zlU7toTxO/lGNc8UAZ OPtkMwlW0BatK0kUNCjxC6gq3lC9cPluWBmRkPWaTS8MZvz1oTs1G7X9p9JqJB9bxRRn 90OA== X-Gm-Message-State: AAQBX9f+/ApFbKaiRbWEg2zwk9ZOoHothqKlCT6ZPYGIBLsQkR2kuvUo 36BivVrvUXqCpwzH8nME+RkSDw== X-Google-Smtp-Source: AKy350bhWuv8l4xbkOG83XJs5OTDFxSQo6hP86nRCvWtzPSnGTDj6JV9qccrOBzrmbTmGm5aW0p66Q== X-Received: by 2002:a1c:f719:0:b0:3f0:a9b1:81e0 with SMTP id v25-20020a1cf719000000b003f0a9b181e0mr15260941wmh.19.1681893231030; Wed, 19 Apr 2023 01:33:51 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33:50 -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, Len Brown , linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER) Subject: [PATCH v4 3/6] thermal/drivers/acpi: Use thermal_zone_device() Date: Wed, 19 Apr 2023 10:33:40 +0200 Message-Id: <20230419083343.505780-4-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/acpi/thermal.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 255efa73ed70..5763db4528b8 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -789,6 +789,7 @@ static struct thermal_zone_device_ops acpi_thermal_zone= _ops =3D { =20 static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) { + struct device *tzdev; int trips =3D 0; int result; acpi_status status; @@ -820,12 +821,14 @@ static int acpi_thermal_register_thermal_zone(struct = acpi_thermal *tz) if (IS_ERR(tz->thermal_zone)) return -ENODEV; =20 + tzdev =3D thermal_zone_device(tz->thermal_zone); +=09 result =3D sysfs_create_link(&tz->device->dev.kobj, - &tz->thermal_zone->device.kobj, "thermal_zone"); + &tzdev->kobj, "thermal_zone"); if (result) goto unregister_tzd; =20 - result =3D sysfs_create_link(&tz->thermal_zone->device.kobj, + result =3D sysfs_create_link(&tzdev->kobj, &tz->device->dev.kobj, "device"); if (result) goto remove_tz_link; @@ -849,7 +852,7 @@ static int acpi_thermal_register_thermal_zone(struct ac= pi_thermal *tz) acpi_bus_detach: acpi_bus_detach_private_data(tz->device->handle); remove_dev_link: - sysfs_remove_link(&tz->thermal_zone->device.kobj, "device"); + sysfs_remove_link(&tzdev->kobj, "device"); remove_tz_link: sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); unregister_tzd: @@ -860,8 +863,10 @@ static int acpi_thermal_register_thermal_zone(struct a= cpi_thermal *tz) =20 static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) { + struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); +=09 sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); - sysfs_remove_link(&tz->thermal_zone->device.kobj, "device"); + sysfs_remove_link(&tzdev->kobj, "device"); thermal_zone_device_unregister(tz->thermal_zone); tz->thermal_zone =3D NULL; acpi_bus_detach_private_data(tz->device->handle); --=20 2.34.1 From nobody Tue Dec 16 11:49:24 2025 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 C3E15C6FD18 for ; Wed, 19 Apr 2023 08:34:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232726AbjDSIeW (ORCPT ); Wed, 19 Apr 2023 04:34:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232683AbjDSIeJ (ORCPT ); Wed, 19 Apr 2023 04:34:09 -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 CA23AD32F for ; Wed, 19 Apr 2023 01:33:53 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f09b9ac51dso85856545e9.0 for ; Wed, 19 Apr 2023 01:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893232; x=1684485232; 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=CO5jbBs58eoibeB500jlo8tkaZUwialhUILZ/mxzasCOkfacYHjPZn/iSVXhKoUO91 bTPTsV0xmV4SVP/B2qJARLMp5mzmlaGf3Dx9vLeA3oUdYxhsAZfO0peVQqrFU8L6bCbW GxXVeZp1g0WHFjRq+jkuJEyLXajzQQRcMUmUz5PHuoCMN+++vqyG2V1CmbgTl/LfbdJ+ T9pPZrhPf+qD5YxS0JFAjcbtdydgCNjsiVr1MBjjDnRhVVlKKmy0j/WAKk+Z5f5SvF1N RhEFhWmKE1zf/ScN8YfXNkqGqBSCWj25EQkCs91/ZbDK4vK3ADWNJRU6Iz7sXr5G8Hk5 aEjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893232; x=1684485232; 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=DCP5K57f5GSPvglvKiGOxomMjVQeXNrdXIK+Ieky2cePkkjTJYJHVWNuZOqj9Y82xp /xcUMCiHZZE71K2iZYDJfvJ5gNFJe9GzXPjLHPPFEa4pVyhEwuqAGcibxqmfw/1ko8RY NuuEqJAXSDIBJr6C1wwJr1oNG87GPsBg1blojqXEoGLQOBhv/CAz2LBfv48VKH1eeD7y vMd3SDa0OMXuhcPqjHn3JvQZ2t01KNlxUxEQx6kvFg1qRlq7s3NKC4837DQa6e75OZEA xTLcPOwUQXntVzupCobk7dcvMjm3HwQ1hXglfLCnqfKPajLI1LUOCnDijZJvXTPWhpSC KwSQ== X-Gm-Message-State: AAQBX9e0pZrLkFlNhMESLUUJMlQK/1/Qa++/0agzcu306tKzWJ5bWYPZ VKIj6+m3m8k8L+uxFfGMDXvggg== X-Google-Smtp-Source: AKy350Z7VqYlBRj/RFO8d6zcdWtuIqi5exUOJhOIPSy4PJYAZ2EtITGlQNN9EX6k459/d0eIqVr/Eg== X-Received: by 2002:a5d:4573:0:b0:2ef:bac1:9c48 with SMTP id a19-20020a5d4573000000b002efbac19c48mr1406536wrc.6.1681893231938; Wed, 19 Apr 2023 01:33:51 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33:51 -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 v4 4/6] thermal/drivers/menlow: Use thermal_zone_device() Date: Wed, 19 Apr 2023 10:33:41 +0200 Message-Id: <20230419083343.505780-5-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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/i= ntel_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_ha= ndle handle, u32 lvl, =20 result =3D intel_menlow_add_one_attribute("aux0", 0644, aux0_show, aux0_store, - &thermal->device, handle); + thermal_zone_device(thermal), + handle); if (result) return AE_ERROR; =20 @@ -436,7 +437,8 @@ static acpi_status intel_menlow_register_sensor(acpi_ha= ndle handle, u32 lvl, =20 result =3D 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_ha= ndle handle, u32 lvl, =20 result =3D 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; --=20 2.34.1 From nobody Tue Dec 16 11:49:24 2025 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 5DFD9C77B73 for ; Wed, 19 Apr 2023 08:34:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232661AbjDSIeZ (ORCPT ); Wed, 19 Apr 2023 04:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232692AbjDSIeJ (ORCPT ); Wed, 19 Apr 2023 04:34:09 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B2A01026E for ; Wed, 19 Apr 2023 01:33:54 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id o29-20020a05600c511d00b003f1739de43cso1007579wms.4 for ; Wed, 19 Apr 2023 01:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893232; x=1684485232; 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=ZFr0nNH7gKvfGd1xmrDdwsbO4A4hFnitswKb+PdA3E8=; b=W/Tqw/dMvtEe3FajEF9yCwGnfzmUZEjH+Tif9EgeaHJIdCUZf++mkSpx6eNr2zFb3B ev+9mSAGmiJOJ/xVRku+fLPsaOHjzLH2vkIUvhFYMXg7qd0Fk1N8vHRCL4CXq+60iHAG KpfoO799aCEpb1snZiiflY8lj4Yo2MXdArjEAeSUWr98PgdJ6U8mRomWqj566wQR1ZhZ LhHNRCim/aJ0ubva7AbwrKjtojJ2zcS0hQABDMbqunXxyXfaEQcEd12Y4zJsuyqNN9B3 iUAWLfYe3gGZ+lxE+JU/R7HFQWChRETiFZ0meFXZBsdJZdALiwBMGzcLOM7cIEOkwhvT QgQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893232; x=1684485232; 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=ZFr0nNH7gKvfGd1xmrDdwsbO4A4hFnitswKb+PdA3E8=; b=HSuBe23xdfCfhDr53Bt/0ureB943I6BeXHy+U3vLG0umkEa8TnT9OVRb3kb1Qphxli winQ5opO8Fqm6qKblIGh0FJepefVxvHwLvgKpgBUcaO3Xj5KaCg8NYzdhDw98/UA4YJZ FXxVriGhI77wzUojHmc/F/nR+8Ychws3LiPy6C0i26WXEMrdH2D/Vz0ybSX/Psmf97h1 IvjZwGQl6J1yd2CZRTYkJQZhI2hCzdqy6XSotQ10GhvBHu9TPTYQzMl9U9l6MkbcMn3T IYDMWus10G3pxu6bfvmnOP452YOSj5tnNJI1r1L+w3Bf7q4TYQDzceCUsgDIi6KzgYMO xLrg== X-Gm-Message-State: AAQBX9dksAnXTiaBBMOC9si23fZ0bDeyNjE3/6yv5dzpD9iyBF8STJLR 12qB36H87VlNTT5GQO3KdM+Y7Q== X-Google-Smtp-Source: AKy350bEQa6B5ZqLGlKS+oPmo6grbCsWKBRQGeNInPxEGgjFovGVroUCPj9Lo+sCs3xC28bfbvM3Cg== X-Received: by 2002:a1c:cc05:0:b0:3ef:d8c6:4bc0 with SMTP id h5-20020a1ccc05000000b003efd8c64bc0mr14793730wmb.40.1681893232730; Wed, 19 Apr 2023 01:33:52 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33: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, Len Brown , linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER) Subject: [PATCH v4 5/6] thermal/drivers/acpi: Move to dedicated function sysfs extra attr creation Date: Wed, 19 Apr 2023 10:33:42 +0200 Message-Id: <20230419083343.505780-6-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The ACPI thermal driver creates extra sysfs attributes in its own directory pointing to the thermal zone it is related to and add a pointer to the sysfs ACPI thermal device from the thermal zone sysfs entry. This is very specific to this ACPI thermal driver, let's encapsulate the related creation/deletion code to group it inside a function we can identify later for removal if needed. Signed-off-by: Daniel Lezcano --- drivers/acpi/thermal.c | 52 ++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 5763db4528b8..9a90b1a117cd 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -787,9 +787,34 @@ static struct thermal_zone_device_ops acpi_thermal_zon= e_ops =3D { .critical =3D acpi_thermal_zone_device_critical, }; =20 +static int acpi_thermal_zone_sysfs_add(struct acpi_thermal *tz) +{ + struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); + int ret; +=09 + ret =3D sysfs_create_link(&tz->device->dev.kobj, + &tzdev->kobj, "thermal_zone"); + if (ret) + return ret; + + ret =3D sysfs_create_link(&tzdev->kobj, + &tz->device->dev.kobj, "device"); + if (ret) + sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); + + return ret; +} + +static void acpi_thermal_zone_sysfs_remove(struct acpi_thermal *tz) +{ + struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); +=09 + sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); + sysfs_remove_link(&tzdev->kobj, "device"); +} + static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) { - struct device *tzdev; int trips =3D 0; int result; acpi_status status; @@ -821,23 +846,15 @@ static int acpi_thermal_register_thermal_zone(struct = acpi_thermal *tz) if (IS_ERR(tz->thermal_zone)) return -ENODEV; =20 - tzdev =3D thermal_zone_device(tz->thermal_zone); -=09 - result =3D sysfs_create_link(&tz->device->dev.kobj, - &tzdev->kobj, "thermal_zone"); + result =3D acpi_thermal_zone_sysfs_add(tz); if (result) goto unregister_tzd; - - result =3D sysfs_create_link(&tzdev->kobj, - &tz->device->dev.kobj, "device"); - if (result) - goto remove_tz_link; - +=09 status =3D acpi_bus_attach_private_data(tz->device->handle, tz->thermal_zone); if (ACPI_FAILURE(status)) { result =3D -ENODEV; - goto remove_dev_link; + goto remove_links; } =20 result =3D thermal_zone_device_enable(tz->thermal_zone); @@ -851,10 +868,8 @@ static int acpi_thermal_register_thermal_zone(struct a= cpi_thermal *tz) =20 acpi_bus_detach: acpi_bus_detach_private_data(tz->device->handle); -remove_dev_link: - sysfs_remove_link(&tzdev->kobj, "device"); -remove_tz_link: - sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); +remove_links: + acpi_thermal_zone_sysfs_remove(tz); unregister_tzd: thermal_zone_device_unregister(tz->thermal_zone); =20 @@ -863,10 +878,7 @@ static int acpi_thermal_register_thermal_zone(struct a= cpi_thermal *tz) =20 static void acpi_thermal_unregister_thermal_zone(struct acpi_thermal *tz) { - struct device *tzdev =3D thermal_zone_device(tz->thermal_zone); -=09 - sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone"); - sysfs_remove_link(&tzdev->kobj, "device"); + acpi_thermal_zone_sysfs_remove(tz); thermal_zone_device_unregister(tz->thermal_zone); tz->thermal_zone =3D NULL; acpi_bus_detach_private_data(tz->device->handle); --=20 2.34.1 From nobody Tue Dec 16 11:49:24 2025 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 B88FAC77B73 for ; Wed, 19 Apr 2023 08:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232761AbjDSIe3 (ORCPT ); Wed, 19 Apr 2023 04:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232698AbjDSIeL (ORCPT ); Wed, 19 Apr 2023 04:34:11 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1FED448A for ; Wed, 19 Apr 2023 01:33:55 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f09b9ac51dso85857155e9.0 for ; Wed, 19 Apr 2023 01:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681893234; x=1684485234; 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=2iK+POleBc/byLDVWHTc7+1oZoRzGsPyfNa6vjT15MA=; b=hDC/3pV2pCYg9oQ01G9q6YLUoP6cci4sRaJx3Sm5aYj4inrNFdmQ0mTiaMAmkpYqm9 0xkuWur4JvIUEUoV3CFBiJ+DLWUI3zMbQNrNGoPySCbgHu3PXFnRA3fJxnrD2GgIQiW9 yp93aq1KKEn3xocQvrR9R1rG0h4yZQDeJ1Bs/2V12tAVzCd6z5j9zhb8zZNGmg6i8XVe M6JQEM+p1lUwGJQPxu0Xzs9Q5gASTJUEGdNBC9QIkdOA9t8kohMjsPc0AeUEWzC4EaXq +bozF8bHPsJ/OyG9sxp0agODo83vJjFcmO0NYgxTTgda9dvsjLHYR2fcEUOcBmDXU821 /HEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681893234; x=1684485234; 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=2iK+POleBc/byLDVWHTc7+1oZoRzGsPyfNa6vjT15MA=; b=Y0Y8Br5OR8qsIvZ7Ok+Zojb+mezlkLdOxwAn9FoPyJz1v310QpK+hLrNZ9Stgaq02y iQXn9HeMaNvwUuoavDeGwSCm4dhfnjfcnEDoyh8jsDXEhb6W2829teFeePr6EI7s93Li TxVhCO+jbuZdG0axSjuHRu4HOQABUzqzMN85c5WRKyCvVCTY4Y+i07b1dDsfNIG65zqM +qTryN2BPgZJQR9wwSOfRbfLMbP101AGnBunU8orZ+paHZmEuZY13Ed8IQn0AYvarHiK sYjYe5msM1xLV7eO1FVAaJbV4Vta7MX66SrkVHP2w+wOHelLls9g0xCcaPoAehV2cpkk lSxg== X-Gm-Message-State: AAQBX9fpKwC/MCOFdFHL0Sxwbg+dGAxzu1SmfRxfb+7KiJ0L82EfPGNe lnDiIqAwT0d5zPkTBTZPzUaxGg== X-Google-Smtp-Source: AKy350Z0vLK/BVPhd0fv9yEhIp66hfcg8Jnye9y9U1dRBnP+hcAFpjOBAiRmf5V3xMdhwyW+fny/sQ== X-Received: by 2002:adf:ec86:0:b0:2d0:58f9:a6b with SMTP id z6-20020adfec86000000b002d058f90a6bmr1143426wrn.13.1681893234264; Wed, 19 Apr 2023 01:33:54 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:a794:9fb2:29fb:606d]) by smtp.gmail.com with ESMTPSA id s5-20020a1cf205000000b003ed1ff06faasm1442033wmc.19.2023.04.19.01.33.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 01:33:53 -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 , Randy Dunlap , Srinivas Pandruvada Subject: [PATCH v4 6/6] thermal/drivers/intel_menlow: Make additionnal sysfs information optional Date: Wed, 19 Apr 2023 10:33:43 +0200 Message-Id: <20230419083343.505780-7-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230419083343.505780-1-daniel.lezcano@linaro.org> References: <20230419083343.505780-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The Menlon thermal driver creates auxiliary trip points in the thermal zone sysfs directory. It is specific to Menlon. Actually these trip points could be generalized with the generic trip points in the future. Let's make the code optional and disable it by default so we have a consistency with the attributes in the thermal zone sysfs directories. If that hurts we will enable by default this option instead of disabling it. Signed-off-by: Daniel Lezcano --- drivers/thermal/intel/Kconfig | 11 +++++++++++ drivers/thermal/intel/intel_menlow.c | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/drivers/thermal/intel/Kconfig b/drivers/thermal/intel/Kconfig index cb7e7697cf1e..ef7ffe6b56a0 100644 --- a/drivers/thermal/intel/Kconfig +++ b/drivers/thermal/intel/Kconfig @@ -112,6 +112,17 @@ config INTEL_MENLOW =20 If unsure, say N. =20 +config INTEL_MENLOW_SYSFS_ADDON + bool "Enable extra sysfs attributes in the thermal zone" + depends on INTEL_MENLOW + def_bool n + help + Create auxiliary trip points in the thermal zone sysfs + directory. 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/i= ntel_menlow.c index d720add918ff..605983be516c 100644 --- a/drivers/thermal/intel/intel_menlow.c +++ b/drivers/thermal/intel/intel_menlow.c @@ -367,6 +367,7 @@ static ssize_t bios_enabled_show(struct device *dev, return sprintf(buf, "%s\n", bios_enabled ? "enabled" : "disabled"); } =20 +#ifdef CONFIG_INTEL_MENLOW_SYSFS_ADDON static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *= show, void *store, struct device *dev, acpi_handle handle) @@ -398,6 +399,14 @@ static int intel_menlow_add_one_attribute(char *name, = umode_t mode, void *show, =20 return 0; } +#else +static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *= show, + void *store, struct device *dev, + acpi_handle handle) +{ + return 0; +} +#endif =20 static acpi_status intel_menlow_register_sensor(acpi_handle handle, u32 lv= l, void *context, void **rv) --=20 2.34.1