Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4603675rwl; Mon, 10 Apr 2023 13:54:55 -0700 (PDT) X-Google-Smtp-Source: AKy350aYo75xJJr+lDxzTL+69VLrRNDydicOKq1Oru2Typi7Xrq47BB2HFHvi4RQ1RWKn+QsaXMQ X-Received: by 2002:a17:90b:3807:b0:23e:2b3c:d4bf with SMTP id mq7-20020a17090b380700b0023e2b3cd4bfmr11544482pjb.45.1681160095473; Mon, 10 Apr 2023 13:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681160095; cv=none; d=google.com; s=arc-20160816; b=HhTQlyvi+BcFGWinwJHmE7LEYIt5qXanXCVz/5sUWHdo7iRMhWFKz8rY3ZmWLJwesU sF8eq5uVIWf0d2ETMS7jeTlUX76VJGKNNQIFdbnJp71tSoTFZJcVtTmaOczj6e2Hn9oF wX8HS7AUVqxTvKOQz/hzvlsfYx9SxGkRHtudDMkylZXTCg8LPmkuk0c9PMotlEO4/Qfv XhRofSfPqZq07MBj58tzl8/3VFkl9c94BA6zV7MPxASZtOn/Wc89If/NdOHUa4efq6zh jZs8IeFXMLQ3VfG8eMBuR7FXTPbVycL8Y7LX61ixuJf51cgGhRtH8vZ0Jo21a5hbDp0t p2TA== 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=c/sUNls5odRG1ROzcXK2u7tbJwmZU1qshXeSsb4erJk=; b=JXKvFkYfojXMhh//usKl1hkKUvxUjk5Gut/PAzcNICcoXAnjgguGj1RQ2w3zN48RFg lHrV1UcKsOCsU8TgLGPBM93EmAKshWpXiz5zTMv8I/iHCx+02dxz7j/wkyF5xQeDjWVX tigMRekKKvz2Cp2ZF4fqregPcM/z3/sXet5ulIZ0tvCYr6MJ9vG7Ll598gVljrjbN1Qq VR0gtPVNYWcwRFtzhccK77jSE+oBsJ2Mo2SOomcuNGtCX7Sv9FClK4aGRNpffhZuoWiH Ot3/DC2T9t6jjqeqLBGxN65O++9O/bix7VKUNiDyQtT/0o0vJFbd/39vcE/axt+Ue9ON w7OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ImG0P6oz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c1-20020a17090a020100b0024675a05d78si7126932pjc.127.2023.04.10.13.54.43; Mon, 10 Apr 2023 13:54:55 -0700 (PDT) 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=ImG0P6oz; 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 S229836AbjDJUxu (ORCPT + 99 others); Mon, 10 Apr 2023 16:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbjDJUxo (ORCPT ); Mon, 10 Apr 2023 16:53:44 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2625C2105 for ; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id j11so9189186wrd.2 for ; Mon, 10 Apr 2023 13:53:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681160019; x=1683752019; 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=c/sUNls5odRG1ROzcXK2u7tbJwmZU1qshXeSsb4erJk=; b=ImG0P6ozhsBNn2wIjXrzV3X3+4UFaj69tjUiqut6D5oEacUyt77fF1/z7QsFadCFKb sj+zrnaINyC/6hK37e/jfrNS2KxcuKodwPNwUAn/B+8Akkxk+PqF4fZMo4iyy4cC6IIg MOfHE4ZDYTsL75qlt0hHpDuq/tQV+d2hwHE5NLOK0SJZ9KbpPpxZwZSzFDIeyM7xUoIC 5g5wpbsopEZA9PZOG8Zf/mQB26B0RbHXXwqzRoxQjTzwjcXf49+nUQWxTb8k3e09n+KX 7tizEJmJSj1XjpfaXM0AYw+l8fDd5WkqVRb0n5o4ySXkON7M3ZK6URKcwl/qL+WkHuNP Ab9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681160019; x=1683752019; 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=c/sUNls5odRG1ROzcXK2u7tbJwmZU1qshXeSsb4erJk=; b=x8r8H8oHAfTKWEDGNSumojuEypBBVmH3/1sEiFNRvXcm0LRO5ju84I/cOdYSK6+WlT 4+saBJNHCoJmaPIqDfwoLwOi8SBp0nfcVEtZ3nFblTvoTrK8VWoYpoZCA1sCgO7kwKAn tSgxl2lvmkITY3Gu4zxuljOIphtgq59h+rY/2u7ete3tLloeEu+AiVy6NpTgX9GdjgXt MnfitjX0BqbRnc0TX0gHGFf6lXqc2p8ALvp+7afGE74iaP0NMTW5utLsiEju0AbdYhv5 3DWnDdajAYOdRH17LOqb3Hdif11V5lfKt0jy8xN/u1nzTz5HZr4JnyB8eUagdGlZ1sx4 MA0Q== X-Gm-Message-State: AAQBX9cePVnxqwA1A68cEgUdyOiDBH7RQbB+3mmFIX/bgS/CtwN5U4JN rmQ/1TDKYS1sGQFnwfj0laiAKA== X-Received: by 2002:adf:e3c5:0:b0:2f0:2154:761 with SMTP id k5-20020adfe3c5000000b002f021540761mr3895233wrm.37.1681160019534; Mon, 10 Apr 2023 13:53:39 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:2611:592:3b9e:d2ae]) by smtp.gmail.com with ESMTPSA id e17-20020adffc51000000b002ef2e148d59sm11966789wrs.16.2023.04.10.13.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 13:53:39 -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 v2 2/7] thermal/core: Encapsulate tz->device field Date: Mon, 10 Apr 2023 22:53:00 +0200 Message-Id: <20230410205305.1649678-3-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230410205305.1649678-1-daniel.lezcano@linaro.org> References: <20230410205305.1649678-1-daniel.lezcano@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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. 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 *, -- 2.34.1