From nobody Thu Nov 14 06:28:05 2024 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 EC04EC7EE2E for ; Tue, 28 Feb 2023 11:24:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231612AbjB1LY3 (ORCPT ); Tue, 28 Feb 2023 06:24:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231600AbjB1LYI (ORCPT ); Tue, 28 Feb 2023 06:24:08 -0500 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 173CCA3 for ; Tue, 28 Feb 2023 03:23:30 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id bx12so6178554wrb.11 for ; Tue, 28 Feb 2023 03:23:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677583409; 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=/h75YgLAzThWP+FOpMQKnxnohte85PKa1jrYzQU01Og=; b=EoPFM3nXOOVR3R9zMG/bqeRFGOggehpwTgel7J0QSyd9r9qjGkmkhXtuT3hSdMaD/n 8QCUYF5zzqN3LGiu6czsKP1mNpEoQyT3w025nGAMiVA0RkHThb7QbL6Za2gZExEFb0OP KI1PdtT+75sKVg8TzLFM0WYj/ud2bkxRy7L+pTAY/LH6OvbvbnZPqiYBUUF97HS1EKqP o66HEBOa0s82DwD8H4GNnaW2KF/psP13Crp1FEcrYqqXdSHxingmCYOeDzF5xKXUDTmG U86j7g23P+ZRFEVwjqpTfSCZrfNQRRbKtJ+r6tLPSwIoEcnRrURV28VeHa4w2afSaMR2 xDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677583409; 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=/h75YgLAzThWP+FOpMQKnxnohte85PKa1jrYzQU01Og=; b=W7hZp4XwaqSrjyV5v0JFnKYjznf/9nWvw4kjBRayoLqLeeKLxRi+IbeC06THAN4nlR NX0Bs6++113k4MXaB5d/HTJjPq9EPXUfjQwmpUHcjGDGrmgJVPy8RoCqxCPV/1HFJrgZ pRn4StfQUBCPQ7XQx3Sk7wDGF77yrCfcnCt2dmDRxmFY3yUyZagOi9FLyX3f/wz6omjT 4tnmvPIiecAP2WWYkXsduFKQwAQmQcbU39kE4hRpqiC40H4c6huxduSILa3+2+w9OujL FOKc6fbZgs32E6/1JtVxmRWzDUXLYX6VZcwd6YUMflbA7g7rdhiJCv12COvFXeyzzp/g 9m1A== X-Gm-Message-State: AO0yUKWXh0JLllAQrhTvjQWyOI8eQx+7ZV1PneV4tsmPMA3qN7hkMz1j y8teDmBAlKjgjs+LF3mACTomHw== X-Google-Smtp-Source: AK7set83C+IPXo+v9Py+BS5DoZCn57Ys6WIwQUCbxSOTUvKfKPlYHOKz0RpI7oXIE5//MQ9SN+fkjg== X-Received: by 2002:a05:6000:1705:b0:2c6:c9f1:e444 with SMTP id n5-20020a056000170500b002c6c9f1e444mr8212787wrc.16.1677583409540; Tue, 28 Feb 2023 03:23:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 03:23:29 -0800 (PST) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@linaro.org Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Amit Kucheria , Zhang Rui Subject: [PATCH v4 10/19] thermal/core: Add thermal_zone_device structure 'type' accessor Date: Tue, 28 Feb 2023 12:22:29 +0100 Message-Id: <20230228112238.2312273-11-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 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 thermal zone device structure is exposed via the exported thermal.h header. This structure should stay private the thermal core code. In order to encapsulate the structure, let's add an accessor to get the 'type' of the thermal zone. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 6 ++++++ include/linux/thermal.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9fa12147fead..913ba9ca9792 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1384,6 +1384,12 @@ void *thermal_zone_device_priv(struct thermal_zone_d= evice *tzd) } EXPORT_SYMBOL_GPL(thermal_zone_device_priv); =20 +const char *thermal_zone_device_type(struct thermal_zone_device *tzd) +{ + return tzd->type; +} +EXPORT_SYMBOL_GPL(thermal_zone_device_type); + /** * 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 7dbb5712434c..21686e676b3d 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -366,6 +366,7 @@ thermal_zone_device_register_with_trips(const char *, s= truct thermal_trip *, int struct thermal_zone_params *, int, int); =20 void *thermal_zone_device_priv(struct thermal_zone_device *tzd); +const char *thermal_zone_device_type(struct thermal_zone_device *tzd); =20 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, struct thermal_cooling_device *, @@ -443,6 +444,11 @@ static inline void *thermal_zone_device_priv(struct th= ermal_zone_device *tz) return NULL; } =20 +static inline const char *thermal_zone_device_type(struct thermal_zone_dev= ice *tzd) +{ + return NULL; +} + static inline int thermal_zone_device_enable(struct thermal_zone_device *t= z) { return -ENODEV; } =20 --=20 2.34.1