From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E74432DCBFC for ; Sun, 19 Apr 2026 18:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622956; cv=none; b=iaCME61AJ2s3+ugBzfg5sZ9WBdjZNshtrH7NHEyP41mjSFATljaotF4BU0cFUC0foaIC1Ya7+9bM82f/G4RSyGvGDc0uRE5nScqj2eKTdyMobJ5GYFNt4XM4HX5retZlgp57/V0YhHU4I46JTgz83E/lz98SXuZzZeYVAILb8DE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622956; c=relaxed/simple; bh=Y5QeZARN7N3l8TrjUL9gkwuxX1udIH2jTgvXmLkTbGs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vc9rMxAi5ayowbT7TVS0HvbO7qmkJVPp7tF07hn+7rsvdCLmAxDFDqDBy4bftJk0Vwiv73uQSMVqFeaXIOkar9B8mWZnWJtub/vVls/jj5pauR4FRYNAk5o8e/nZRmNRzE1kRXm//LSB6CzNol+X5jxEOVAGg4LJadi3UXJnXik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=fR/kbv6y; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aeBl6nVL; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="fR/kbv6y"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aeBl6nVL" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63IN0aPc1564612 for ; Sun, 19 Apr 2026 18:22:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=Id99JuSnTtg UpQfz1lcAgo+qRwxEaTN/a4aEv+mMZ7g=; b=fR/kbv6yuw2Javw4aiZzls9kvWP hXh6FMerTskNuujJ63dhQ5iFe5WuXxavHWJ2M289iDfcxA49kMs/oBu+fBk7qCHK 8VoDOC4w7JlGlDrV0rNUxsbBAWPzdylTabsD+63TaBGM8enIJp+DRmIlpymWVr/A PZaJ0hjZ3ljXtixb3hj3Ot6e58BIOMcUYG0bhFbK14LqgrV4ycrcByrN3pDhEgdR QFvBGev9r3DkyyoYp5wucigwl5JRjsIGgNhM4I8SfsUOulx9y+3NQm+/Rlgi00vX NM9HGZo9OIaOav6hQ9RZdjqN4/63eXyyZOqhrscjhZ2TeivoyV+s9xU6IcA== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dkyank9ah-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:32 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50b52a2d70cso51684661cf.3 for ; Sun, 19 Apr 2026 11:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622952; x=1777227752; darn=vger.kernel.org; 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=Id99JuSnTtgUpQfz1lcAgo+qRwxEaTN/a4aEv+mMZ7g=; b=aeBl6nVL4tKd2pbSNhMyxLP7zRUiYJ/PiZVkpx+bztWv4WxNxIqbT5D1GaRUc1bTc6 uWo1AuW/81XjQfMsgQUBnXIIl3IEXiS1u9LiE1sfcegHoQpdmmXms5B7DIySUMKLuZlW 3sgoSg2TMBI9q1HRLUoFfs38ZGFUBKjuybODsyG4ymBsMBEQKfNGMj5RjEmJfnAi3Enz IXKp2pdpxfrnUHye8FfL+HTmopsVw7z82k/r/s+B2fVKu9//ijHQ203uFlJEK62wwxj4 Be0C3L/C4pKA0sFTe1MQ+cVzA3+tY9KHsVJJMFF9mo7ulApPkSiZh5r6VhXoYeRVA86w DFfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622952; x=1777227752; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Id99JuSnTtgUpQfz1lcAgo+qRwxEaTN/a4aEv+mMZ7g=; b=hcnY1GRx9JIjsEfTCWXcMBJdOGqiMGLJJrLNSXnfopPdt991/ssjHt4lqQWvpeplhQ tWLE6werUQDaNOGKnf8Ms6TGUp1wJhFZEuu8LpjzvVhipG2t7NpY54Muk7uMY+zpj1eH /U8Lz0JhslYBbpXUTrMIJRDludsSPbGmKEGyDQ83On9EF1NqNs6QYuMTPm3ZHOcieZxV 4PTSKGfUqxz+tQl6Njo5rO8ZnoJFDpIJUcA6Htn5NXjGLxUsFBYyfrdYUuKiKLm4pZfX v06+97SdmTH+Exxo4xYmukG/P3C74cVVo00DHFxQT4k1AKTgSdP+rilLSz5mQNYeEwdv HE1A== X-Forwarded-Encrypted: i=1; AFNElJ+4Ta4I3kQuZPdzDhGhik08m8sL0qtwnzrvWPTZwZ4uCh8uKnM9wOi4ODyLr9YlHZmbKRl8eZTte7cDGiM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxi1lCsldXiZz3Bkh2VR4L+Xy3cVoZJT/RtlBtndGB6Au4ApE78 y/zu27hhE9E80LX/EOrfgpNdiIuKgxgnFz8fITqQG0P4xcU1WUm5GeRI75/cFm6GARUWwuj4FFc L6fCoP6poPqRNPhnU+mFhEWF5VQ5Y0DbbdK4Wc3fhDKvDKRjp8OxWprYicB2CQOKO8PQ= X-Gm-Gg: AeBDies2ydJtalCI6EipzHSDbPc2tG9YvHgYpBtdVtKfhoLW2Lr1ezTaPczxaN4h8YD A04jnCtpY7ZaO15H/oP0qLrP6esuiqQ3LvupTqkMiObaHoEA9x4+EFzz0BYzldF4aqjIPd0tn9a tQfntnNo3bmc+RD46VT7NwNhDj6qUD4NigQN73C80UrEzkjEgYK/xxsnRZRZb6sCiEqhPwhjC1B AlybECAORPAsePm4Y7p910EHGaQR66UEAbk0xUxBqzPlBlbU7LHcGZUyCuQEiBQStaZpI5AfoJi mDUPJpvlZkndOSHh2+ClxAcExnv/Y0jypq5LY1EktHH76Eieh0Cy3mMZo2MRY5mJORaE5gXgYgA zmUAv1YNuuiAuOtLZ7TXj2xmenSlY3WmGoBTdm5M9pWLdknmvd/nmxlQYRlWb X-Received: by 2002:a05:622a:5148:b0:50d:8bf2:45cd with SMTP id d75a77b69052e-50e36c124f4mr172055441cf.34.1776622952285; Sun, 19 Apr 2026 11:22:32 -0700 (PDT) X-Received: by 2002:a05:622a:5148:b0:50d:8bf2:45cd with SMTP id d75a77b69052e-50e36c124f4mr172054861cf.34.1776622951738; Sun, 19 Apr 2026 11:22:31 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:30 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 01/14] thermal/of: Move OF code where it belongs to Date: Sun, 19 Apr 2026 20:21:45 +0200 Message-ID: <20260419182203.4083985-2-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: phS93YEzQYso3ea4ruhTul-Z0f8yNnvI X-Proofpoint-ORIG-GUID: phS93YEzQYso3ea4ruhTul-Z0f8yNnvI X-Authority-Analysis: v=2.4 cv=SNFykuvH c=1 sm=1 tr=0 ts=69e51d68 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=9vQL-81oGOs3f0jwIh4A:9 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX4IbJfdxj+fB4 1BKYmh/lcbak+XYeOK7DVla94cpx1KitcZ2XqiwOt/omRY+b8FbniFda6YG3YJmyPPaXV/DTjBC P61hO0qsRkWo7NUr9oK4HXvyFcmXTsAZr/qviQ070oStBMhc+0idbmv9errqyO/CUBEQzuLDKKu nPBmkUtZ8/HDZqe+NUXSuObqxh970cIgjtjWOZQ/shD6hao2Sw6UP1+XkwQhns8Q6ePrC8wjvLc 7jk3LV145Ji6dnCM1OlpWAguLLh98BOjS4KKflvRqjXoybCVKFpnzw0nB9GB/Xy+BDDdAGvEkpI rfJfymLdlz9IlG7ZTicBoEp+P8ok4tcvU22jvkGiOrhmDNct8zEvEf5+EQdIu2l0JRqk2KO0vl/ R11AYzPYBXQnY7L/k5TPTjvmoLhqsAHGqBORJENkN906WdHIBWP8i9IoC9bWqJdpHa0dE58rvS6 PDMt5BnsjSlSCAHcKjQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" The functions: - thermal_of_cooling_device_register() - devm_thermal_of_cooling_device_register() are related to thermal-of but they are implemented in thermal-core. Move these functions to the right file. Pure move patch. No functional change intended. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 75 +--------------------------------- drivers/thermal/thermal_core.h | 5 +++ drivers/thermal/thermal_of.c | 72 ++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 74 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 2f4e2dc46b8f..8a70768b46dd 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1056,7 +1056,7 @@ static void thermal_cooling_device_init_complete(stru= ct thermal_cooling_device * * Return: a pointer to the created struct thermal_cooling_device or an * ERR_PTR. Caller must check return value with IS_ERR*() helpers. */ -static struct thermal_cooling_device * +struct thermal_cooling_device * __thermal_cooling_device_register(struct device_node *np, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) @@ -1163,79 +1163,6 @@ thermal_cooling_device_register(const char *type, vo= id *devdata, } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); =20 -/** - * thermal_of_cooling_device_register() - register an OF thermal cooling d= evice - * @np: a pointer to a device tree node. - * @type: the thermal cooling device type. - * @devdata: device private data. - * @ops: standard thermal cooling devices callbacks. - * - * This function will register a cooling device with device tree node refe= rence. - * This interface function adds a new thermal cooling device (fan/processo= r/...) - * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind = itself - * to all the thermal zone devices registered at the same time. - * - * Return: a pointer to the created struct thermal_cooling_device or an - * ERR_PTR. Caller must check return value with IS_ERR*() helpers. - */ -struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) -{ - return __thermal_cooling_device_register(np, type, devdata, ops); -} -EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); - -static void thermal_cooling_device_release(struct device *dev, void *res) -{ - thermal_cooling_device_unregister( - *(struct thermal_cooling_device **)res); -} - -/** - * devm_thermal_of_cooling_device_register() - register an OF thermal cool= ing - * device - * @dev: a valid struct device pointer of a sensor device. - * @np: a pointer to a device tree node. - * @type: the thermal cooling device type. - * @devdata: device private data. - * @ops: standard thermal cooling devices callbacks. - * - * This function will register a cooling device with device tree node refe= rence. - * This interface function adds a new thermal cooling device (fan/processo= r/...) - * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind = itself - * to all the thermal zone devices registered at the same time. - * - * Return: a pointer to the created struct thermal_cooling_device or an - * ERR_PTR. Caller must check return value with IS_ERR*() helpers. - */ -struct thermal_cooling_device * -devm_thermal_of_cooling_device_register(struct device *dev, - struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) -{ - struct thermal_cooling_device **ptr, *tcd; - - ptr =3D devres_alloc(thermal_cooling_device_release, sizeof(*ptr), - GFP_KERNEL); - if (!ptr) - return ERR_PTR(-ENOMEM); - - tcd =3D __thermal_cooling_device_register(np, type, devdata, ops); - if (IS_ERR(tcd)) { - devres_free(ptr); - return tcd; - } - - *ptr =3D tcd; - devres_add(dev, ptr); - - return tcd; -} -EXPORT_SYMBOL_GPL(devm_thermal_of_cooling_device_register); - static bool thermal_cooling_device_present(struct thermal_cooling_device *= cdev) { struct thermal_cooling_device *pos =3D NULL; diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index d3acff602f9c..bdd59947b24f 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -269,6 +269,11 @@ void thermal_zone_device_critical_shutdown(struct ther= mal_zone_device *tz); void thermal_governor_update_tz(struct thermal_zone_device *tz, enum thermal_notify_event reason); =20 +struct thermal_cooling_device * +__thermal_cooling_device_register(struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops); + /* Helpers */ #define for_each_trip_desc(__tz, __td) \ for (__td =3D __tz->trips; __td - __tz->trips < __tz->num_trips; __td++) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 99085c806a1f..398157e740fc 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -510,3 +510,75 @@ void devm_thermal_of_zone_unregister(struct device *de= v, struct thermal_zone_dev devm_thermal_of_zone_match, tz)); } EXPORT_SYMBOL_GPL(devm_thermal_of_zone_unregister); + +/** + * thermal_of_cooling_device_register() - register an OF thermal cooling d= evice + * @np: a pointer to a device tree node. + * @type: the thermal cooling device type. + * @devdata: device private data. + * @ops: standard thermal cooling devices callbacks. + * + * This function will register a cooling device with device tree node refe= rence. + * This interface function adds a new thermal cooling device (fan/processo= r/...) + * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind = itself + * to all the thermal zone devices registered at the same time. + * + * Return: a pointer to the created struct thermal_cooling_device or an + * ERR_PTR. Caller must check return value with IS_ERR*() helpers. + */ +struct thermal_cooling_device * +thermal_of_cooling_device_register(struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + return __thermal_cooling_device_register(np, type, devdata, ops); +} +EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); + +static void thermal_cooling_device_release(struct device *dev, void *res) +{ + thermal_cooling_device_unregister(*(struct thermal_cooling_device **)res); +} + +/** + * devm_thermal_of_cooling_device_register() - register an OF thermal cool= ing + * device + * @dev: a valid struct device pointer of a sensor device. + * @np: a pointer to a device tree node. + * @type: the thermal cooling device type. + * @devdata: device private data. + * @ops: standard thermal cooling devices callbacks. + * + * This function will register a cooling device with device tree node refe= rence. + * This interface function adds a new thermal cooling device (fan/processo= r/...) + * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind = itself + * to all the thermal zone devices registered at the same time. + * + * Return: a pointer to the created struct thermal_cooling_device or an + * ERR_PTR. Caller must check return value with IS_ERR*() helpers. + */ +struct thermal_cooling_device * +devm_thermal_of_cooling_device_register(struct device *dev, + struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + struct thermal_cooling_device **ptr, *tcd; + + ptr =3D devres_alloc(thermal_cooling_device_release, sizeof(*ptr), + GFP_KERNEL); + if (!ptr) + return ERR_PTR(-ENOMEM); + + tcd =3D __thermal_cooling_device_register(np, type, devdata, ops); + if (IS_ERR(tcd)) { + devres_free(ptr); + return tcd; + } + + *ptr =3D tcd; + devres_add(dev, ptr); + + return tcd; +} +EXPORT_SYMBOL_GPL(devm_thermal_of_cooling_device_register); --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BB0729AAF3 for ; Sun, 19 Apr 2026 18:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622957; cv=none; b=dnNmIoKsZr783We7IOyAcAg/B6V9IZ1ApP8/jTqYqyOQmTxUf77ngSDiC4eP60OmWzVEWQl5D+gDcIUxLN+yZWk753W4bzkgWHGAEBjMcS/loOXKlbYt5Wa+K5RyTv7JvQ60T28FYh5+5PFiq7jIPQjxxXP2z0ajZsjmpQ7ZMc8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622957; c=relaxed/simple; bh=93FmgykKd8+qRl6ufmaaI17F7IwkgOHYC9wLgW4PJIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AjlOx/RFbtXV6Vy2gkjBiBO/PtDLS1JsvdD1uELyGPhJNFRl8Ulo4v0Ku6BjsfL7WkKmguNzhPr9DWDCgWPvWqws8s4T7yihnUcC5p7RccZgki5hS9B0koy/E8r80ieeR7345hxFiBLS884cZQfu+/53TD7z+Y8nwIBjEEVrZjo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=GxZ4ofnD; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aJSX7528; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="GxZ4ofnD"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aJSX7528" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63J1KXqM1841259 for ; Sun, 19 Apr 2026 18:22:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=bkLm1BqrU8B KmcLy7fB7L57UurxPvjVKbXp3ftbX+pg=; b=GxZ4ofnDylEpw1CGNXRFu3vEpbv ZBJ/NFOWuQRz3ZcmgmZ/NO3ZRBOu9l3GQjjfNOeuY3PvzXMe9qKmxgi+wgtSHwhj ljLaDqsUmEsPRBLrTJjiVmWOEb65c3VSKLROFaLtyBFOzOerlbto9jHvCaz79s8z b/vqfiLkJvadgLlWNrCWoLlk3yNm6JAF5JIDm+pJnV3PJAFz9RRlyV/spmj/WgSy e+WACatg+LooFXk+3NqpHK3nbTbYnJDYF0SjompwzyfqEnjrB5uEoVYN8rwJwNfP Lw9VAPtG21uXK3PQTr17NvriwzFPPDncg+8RdQRs6p6siMhC7GdKa3u7DpA== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dkyank9aw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:35 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50e5abd742eso5937301cf.3 for ; Sun, 19 Apr 2026 11:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622954; x=1777227754; darn=vger.kernel.org; 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=bkLm1BqrU8BKmcLy7fB7L57UurxPvjVKbXp3ftbX+pg=; b=aJSX7528ZDTFbaWOlnqLvWkBpvnXtlnce3M8+BB/PRyVDPeb5EO+qZO9hvbuGL3Ty5 9KNwrwvZwBq7JedE5m76N1qxNdxPZN6spMW+x2hAW+gA/0AxpW4QqdFgZ32TRHYNdfu7 j+66uq4O0lsMSvfXPGgVV3g6thY60wKXs9SW12ldECvNnvBJMgBqdB7lv4/blyYP6KRP uE//YAZIYaEGzjJNpSzeqjbiLT9H3LTA2mjb8xknN56sqivKXbfzjESMIoLrGXdNbJ5r lG1FFwSTqdjIESmtqmtjW8f3kQO5eENlGeyH7S2uK0gKsav9s33bLzzeMrgXrVBspKSu 69uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622954; x=1777227754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bkLm1BqrU8BKmcLy7fB7L57UurxPvjVKbXp3ftbX+pg=; b=VraFsAmNmKvEEj8j3iLDCszNPvZS2BUCv0Y31qq50IXiiLPkEBbGpSmFdDUSD84Rrx eInUhpY7isFz5xHvNPwSoAz6pGBZ56SF9ELkEAttAZW+rdEV4U2/nbcri+/DrYyYw18E R8oFGP7s1KDmg50QrgCGhbewwxY1KInbDM+X6ZOu6aSwYkLVW2SOoMfq1ih21SUonJD3 bicPpjg5odLZDWy5NkEmLQ8ldLZw0su/j6RHCTwXDAl46NvJf5vUDVPz8ugNp3djU1Ik N0ds42QsgiVX0IX9ajzp9ysZJvZpiwoF2T89hQghihIDkKvaan6aQ65GcFkUduahFrSW NvFw== X-Forwarded-Encrypted: i=1; AFNElJ9OCJkGyzGtamOswZM9LJ3TnRkrvZ14XG7jsk/aVXfQd8yaadIOO2CyR0U4E68sVY5F0w3WWaf8OnbDv2o=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2nBbwhQ4oTQaqMj6s2FfUbcZHfNBB5695CEKqE9VgJVjz52Jp H4x2/ioPpG+6SshkLNdJKp4U7165EP9SeScTsYJwDKPHB22kzmTULuc9SBITp9tcfB7J452aEjH 9/abmu1GMsEHhChx0f4KSzN8X8ht5e69a7EbeutfprizLNFGBwFTBcldtizH1bjtHXVM= X-Gm-Gg: AeBDietzl8Rtr7nX1xdgiPNbyJNFXtom/t31+Q7HJLZnK7hBmCvlM2k5B6si5DwECuC 6fSLOIF7kNMkawXYOEcgqCCm4GkMh2G6cIF7n4Gf6dDJdzur18V6ZQldN7KV8uW9f6yWt/UWPlR LUJp5bd+LaMtRHC+SJBKqKvbQZBHZAFi13qS8BSVG5g103NjMKCzODG5xgTSG6qYNIM+rKKxdbj G2ie9hiKLFz0PK4A9Ato7SmRDIiAFOBk1eJJD6lEeCd3sge5bBFiJkj6hm7ML4iivWukvMErzrQ TGbVqEGbGv2I32GPqtGrMsXe7hoWhC2TvEaJnupDzoANpWlhsdp6ScGVbC6hUX54JNy8xvndUeY lt+LIMBZsr/GnfherCLBouTOH+4F3CM9QkU++t0Jh3xZeVLq6Np8mmi5iTXHl X-Received: by 2002:a05:622a:429b:b0:50d:8049:2f22 with SMTP id d75a77b69052e-50e36b865f5mr151261761cf.3.1776622954600; Sun, 19 Apr 2026 11:22:34 -0700 (PDT) X-Received: by 2002:a05:622a:429b:b0:50d:8049:2f22 with SMTP id d75a77b69052e-50e36b865f5mr151261391cf.3.1776622954210; Sun, 19 Apr 2026 11:22:34 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:33 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano , "Jiri Slaby (SUSE)" , Thomas Gleixner , Mikko Perttunen , Svyatoslav Ryhel , linux-tegra@vger.kernel.org (open list:TEGRA ARCHITECTURE SUPPORT) Subject: [PATCH v1 02/14] thermal/driver/tegra/soctherm: Use devm_ variant when registering a cooling device Date: Sun, 19 Apr 2026 20:21:46 +0200 Message-ID: <20260419182203.4083985-3-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 7xEtA0589q1FhoKhS9MrjAZdGMCAraTR X-Proofpoint-ORIG-GUID: 7xEtA0589q1FhoKhS9MrjAZdGMCAraTR X-Authority-Analysis: v=2.4 cv=SNFykuvH c=1 sm=1 tr=0 ts=69e51d6b cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=B_SRH86IfCqB-oTSwgEA:9 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX5M3qE5Ed2nF4 4MuC0pQwSU25aFT/8EOP3j3nf4DoPZfagBaTzeHn3AeKOh21/LAHfMS52socDbP2tXe+wPfo5JT z2TVy5hCd5j5nBR4jYCOJ9vJvpjyYZEPG6OjrWzHCi0TpZPzVToHr2jyq0FUeQYQ5vbBCHaoYEp ATZgqMXEfT7jyA/cVNLumsy0+pKU+fe8S9Vr1CQgIbFILzFP8KD28pDGSCf0VsUaiWmKi5aepDX 7qjsb6XmBPC68gT4VX/oiZZwGlC8uvSnLrsI9H0Vo1U+SheTO8DV2lWejSYbaaQM8H7pez6cP44 WlBL6DFSPAsQ8DL8vCf8gQY2/GidTQgp0O561JqeLRIe6re3PiTzAlY6Gpg2W/JKdllaAMfTE/4 unYjsVo+iz58RTAtdgKprnyvDd6xOq8b7sG/P1SM1Tr+SEp/ZXvm3hsYdoRM5jYo1M09hUSM52k rov5jZE0dGlb+7Py6VA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" The driver invokes thermal_of_cooling_device_register() at probe time but without unregistering it at remove time. As we have a devm_ variant, use it and the cooling device should be automatically removed. Compiled-tested only. Signed-off-by: Daniel Lezcano --- drivers/thermal/tegra/soctherm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/socth= erm.c index 5d26b52beaba..9d3eb3be2db0 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -1700,9 +1700,9 @@ static void soctherm_init_hw_throt_cdev(struct platfo= rm_device *pdev) stc->init =3D true; } else { =20 - tcd =3D thermal_of_cooling_device_register(np_stcc, - (char *)name, ts, - &throt_cooling_ops); + tcd =3D devm_thermal_of_cooling_device_register(dev, np_stcc, + (char *)name, ts, + &throt_cooling_ops); if (IS_ERR_OR_NULL(tcd)) { dev_err(dev, "throttle-cfg: %s: failed to register cooling device\n", --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 497922EA172 for ; Sun, 19 Apr 2026 18:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622959; cv=none; b=uZHVSVD5kGv6gemP+r1TGyBCTP0ozneUitfViU+/P4eWaZu7CFt9Eo84S3qDsXVuM66MXpqjs/elVWq2+3WgQ8Byim8KpuWZQ7J+CV0byU0ZBCdFdDlAlfLFrurIYQKaRzC/ZCXEpRrBCFwJiCoZDlhyqn1xXrecLKxjXeKZ7tM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622959; c=relaxed/simple; bh=zQ2ofjxFIwHsuU2VATPBF3BRMsEnwHwCQHXoZhFa900=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LUag/TGf9/FWiGklD2BGRcZc8BIlJrkjJY/TZ2SFQVB5ohO7veHfgq0IrER4ncvvkcANuwYvEP6wFro3Yf5DeTkZ/apGYirHDvejPCeXG5TKby8kQTjWGq8dJErKdjqFXMuwV0yppim5cpgUkR3bdQSsaTAG0ioLPlGvfHsSHtM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=kVz081no; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GG31VXF7; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="kVz081no"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GG31VXF7" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63IKfuGi1291838 for ; Sun, 19 Apr 2026 18:22:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=4+JHC4i+rBj /UbYPMg6c3yvjyW0+p6HwFWy5SgpbUGE=; b=kVz081nouZ/JfyllbxjSJxb4QdX cewdwEC02fEp1GmXHQq7tOxv4jY02J7kV/lr65ohyvhcejmLY3j+57xjBLxlmhpB aXBqjiMp3hxiHOzu25KiKhUYZW6vqcTbd81ZJt0I9UB0wth4yAb2fP5wWKuV2gG9 11hYoYpJU/Z5J+qMrmYeblw8Je7bfdkjbGpCe2Ov1LMt+5+anEiSwPB/qSDWpE05 KAN0hkgHIDV5bP0pgtZvuU5aJqTAiPFsjBjlOJtfRSe1gtrMjfEdnXMo5zULRsQA APVJfxRuRwfm5ZPuxc1YvOb3TBnQAihpeTIpSdQQFF5iC6Iy0bieQ2ub6Zg== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dkyank9b5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:37 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50df4c130dbso21555231cf.1 for ; Sun, 19 Apr 2026 11:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622957; x=1777227757; darn=vger.kernel.org; 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=4+JHC4i+rBj/UbYPMg6c3yvjyW0+p6HwFWy5SgpbUGE=; b=GG31VXF7uwCGPVQ3eNqG1hLm25DqTCSm+MAJtsh33b7jCJEbzxfSj59LViGw0AOfcu Y/HHmQceZCmxzcnuxNk4HdzRhTLzaLQiZyFAgKyEOWZQb9IkKFNgu0jUxbRfTEcuOlaH i7dSpMXywlRSjPmFaddu0St4AEREXgChV6Xc8xgcfpr3X0xmI0NFv+81r5AutraaeQcY FjZ4snXybsfQZoIDCkXh+x0f1JKqu9A8Xu2dWR9hW2mxDtYUElYG7vYWKUh/0Mljvp3O knPYrF2luOXkfCPh8GTDVvYXUPCUNP1h6ly5j7H9FZm12txCAT7XkS78IFjXvVmUVxFu TaXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622957; x=1777227757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4+JHC4i+rBj/UbYPMg6c3yvjyW0+p6HwFWy5SgpbUGE=; b=NaBdgm4qlmJbX5fVTi+R33MgW4Ls3dWvtz6rAy6rdkDge10CS2l6e924rUypyQqjIB zFwOXJR0a4rO92G8NPJJYGu3hKEnckpAM3S6xNyHb6o9H1iDT3Dx4HyU/GJnb4Y8eFzh 72tr9Ez2/T5EopIXJ3QqOw5encpnFqm6+a29bUAcNIsHdXo0CVMNxQY1qlYldYNn8T/6 hF/gee87kbs9gcfplcn9LdmYDLWJXHSW2GdvBgTM9NyFqQUcVivXHcbNZBkXscroI56+ cb6lCAtyqbvjHfnX8xwOqvXZxwdY1xyhkRQOe75GYixHoTspJvtFhicetODaZlvoNxoA RkNA== X-Forwarded-Encrypted: i=1; AFNElJ+XAIqUly3p4Q5qCBQ83IMcwCeGDVlLhEZ0KlLnIN/CZDHi5h0fAbSUc8MyKy8S5zEygfy1s+76V0CG4ww=@vger.kernel.org X-Gm-Message-State: AOJu0YydIMT1OlWyRgIf+/posjINNyBl4lk7nDJJ70M0k0itXi9fEncZ YGmmSf3Q7WbnBgtIHZbnMHfQWbou/zawpY2s9NeuTNBi6xQyE53cIm5zLXbDMmlHYyi03BLTpvs LFkNA6WHv36KISoAaFJUuB26nQomUNautQQpwS30Wfo0tQS+e0GOeUbFz2z18krV9oBU= X-Gm-Gg: AeBDietPbshxOm1x7ZZc+U/+24ZaWDjE701lWs+OZPTaIsy2F1SmqjB5HkK0I3ynUS0 6iJxUit7H/JFWMmPfPF7M2Hw7nYcMm4GhbxU7MF+fhN7w/ppBAtuBQkMlwUrOU6bOUATK7uL+lm 2OZhJ74ksIcA66D6j49aLtBPdY63HeK4oWZRhksl1TVvbdswUPatHEU9zzggXmLf+VHJ5M7jKRU X8CyGiKbaKVIVf/ZyvdqkVPNR+pJUI+l62Dl4VvELgSJlE0Q/4kEdEfIsm5xBIP8m8uWkRvgobT D5zMBWKUTUC5ds0IyJ+2Hels8jJ3vGhcMyxhD7uOdEU+qfAlYwL3XBdddyyt2pOh5iHUwIR9Knz fH9JBsXmU7yrcM9kQh+CwymjVvtqfxZsJUYUpeX8/D6B7mlU8o6+b4k/ig0oL X-Received: by 2002:a05:622a:112:b0:50b:328b:cd41 with SMTP id d75a77b69052e-50e36737912mr124060561cf.20.1776622956752; Sun, 19 Apr 2026 11:22:36 -0700 (PDT) X-Received: by 2002:a05:622a:112:b0:50b:328b:cd41 with SMTP id d75a77b69052e-50e36737912mr124060011cf.20.1776622956225; Sun, 19 Apr 2026 11:22:36 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:35 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 03/14] thermal/core: Make thermal_cooling_device_init_complete() non static Date: Sun, 19 Apr 2026 20:21:47 +0200 Message-ID: <20260419182203.4083985-4-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: sR1LUQYrCfdSByuM7s8h4qgh3DuybzRC X-Proofpoint-ORIG-GUID: sR1LUQYrCfdSByuM7s8h4qgh3DuybzRC X-Authority-Analysis: v=2.4 cv=SNFykuvH c=1 sm=1 tr=0 ts=69e51d6d cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=XCaTwWLIzJkqVeeR-uYA:9 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX3VmFXR1G4c/s do59sAHDuYkDCmT67W2AMNTCbOGwo5IVjB1cZcVq8vrPTv/FPJvdokUtro7MmSX1DcWT2JngETu I3Ta05p3elsAz6OnSwpZ4WqriCEJXVci2wlxtam4McOdYs3RJSNOZsC+fqrKefawRv+8kl3fcfH ugJHCdh/3wKhj3Z3WeFaK9X9Yqy7gs6fjepmdUWC6UCv6huQjsQyCw97z5jHGv4ocDLt+LEyW0Q cGdKybomXPby3lI4F5Iy0N53OvykjaU7PPgdyWfHePmUIaSrgY4bmMhC06vFGinYsBRxHJVnivC FNS+1fAAUHjebxqsfrg5xzcJp65FHGje1S6ivAzZ5l9xZxfC9xoES1dCxenDxL1L6heKOy9rlhn G8hWMvD+u1wEizFGADgrMHtCbiPFfxcrfjsobMBgXxIkzoBbCE7qRZx6Q+l2Lf5iuogC5P0pp2y DRxa+dPOso3Dfsaa8vw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" In the process of separating clearly the OF code and the thermal core code, let's split and export the thermal_cooling_device_init_complete() function so it can be used by an implementation inside the thermal OF code. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 12 ++++++++---- drivers/thermal/thermal_core.h | 2 ++ drivers/thermal/thermal_of.c | 10 +++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 8a70768b46dd..35cf170f3fa1 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1028,7 +1028,7 @@ static void thermal_zone_cdev_bind(struct thermal_zon= e_device *tz, __thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); } =20 -static void thermal_cooling_device_init_complete(struct thermal_cooling_de= vice *cdev) +void thermal_cooling_device_init_complete(struct thermal_cooling_device *c= dev) { struct thermal_zone_device *tz; =20 @@ -1127,8 +1127,6 @@ __thermal_cooling_device_register(struct device_node = *np, if (current_state <=3D cdev->max_state) thermal_debug_cdev_add(cdev, current_state); =20 - thermal_cooling_device_init_complete(cdev); - return cdev; =20 out_cooling_dev: @@ -1159,7 +1157,13 @@ struct thermal_cooling_device * thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(NULL, type, devdata, ops); + struct thermal_cooling_device *cdev; + + cdev =3D __thermal_cooling_device_register(NULL, type, devdata, ops); + if (!IS_ERR(cdev)) + thermal_cooling_device_init_complete(cdev); + + return cdev; } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); =20 diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index bdd59947b24f..6e44bcf37b00 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -269,6 +269,8 @@ void thermal_zone_device_critical_shutdown(struct therm= al_zone_device *tz); void thermal_governor_update_tz(struct thermal_zone_device *tz, enum thermal_notify_event reason); =20 +void thermal_cooling_device_init_complete(struct thermal_cooling_device *c= dev); + struct thermal_cooling_device * __thermal_cooling_device_register(struct device_node *np, const char *type, void *devdata, diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 398157e740fc..35d542aac7f8 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -531,7 +531,15 @@ thermal_of_cooling_device_register(struct device_node = *np, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(np, type, devdata, ops); + struct thermal_cooling_device *cdev; + + cdev =3D __thermal_cooling_device_register(np, type, devdata, ops); + if (IS_ERR(cdev)) + return cdev; + + thermal_cooling_device_init_complete(cdev); + + return cdev; } EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); =20 --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 970E62D6407 for ; Sun, 19 Apr 2026 18:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622964; cv=none; b=SVQ1H/EmdV/THEPRFCpi+4s3+2e4aNZhZMObEEaDQ+0SOFTnEYOXC8qKNTvmjuscZnX3sVUVQeitW8R7TYxbN/FcRGea88CcKrEqsfR5yrY7HxsAKF8eExkFdFtC7oVUpiNM9tBph5mSLQn9WJOVqTvwCtmfwjnqK5VxEHUFaSU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622964; c=relaxed/simple; bh=4oS6yClFh8/UMux6OzcPspzOA+Q1/uzIjpGNB1vd66Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MjvhY3BXwlvyHpo9O3zWJG7gnYuLvRhF2lMwjRP1xuLs8N5T6A89bHnzz9RtUv2UzOSuVx9GbgnpkOucNN9bBr/JSbY4Zx1pk4iPQlb6WreGb54mBdNRk8/yauB6/5BEhnGNSDMg6tBv21vxFePEz/mOy+WXSMCCDv8xld/pxSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=NUjqxNE3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=QT0OjeJ4; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="NUjqxNE3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="QT0OjeJ4" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JAo3kr863832 for ; Sun, 19 Apr 2026 18:22:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ninBs3EPIXx rGkgg3vUVv88i5W2pCsOK6agLZvll/l8=; b=NUjqxNE3nA2ty1VUVPMjxDxISkK EPQR8xRaKF4SFgeuXeWrgXKQGE9FM2+64KMAQtl090h9mDbFYYZ6YkNy57xPPs4L bFjqzFap15DKTNFAllB1sVnX8MavPnqEJcls/gI1XegNdCslOTKaqjvtuxl0mdsD N8Di8W6OlBSd3v/8zOPqS7g42yq8Z4qvQoLQQqKVOTst79UF/gMfMPPACjHS8qrj UIAjyWCpS7L7ePb/alfFQpXmVTqqhq2HUV1/W+hnJkDtSoMyq3JTM8S1PQ1zL7TY JBpQcqTUopGNO5FbkPlw36TE6e2K7+TYz4a8ld61OwO0dSmd/D//utVi3RA== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm21ujyr0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:39 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-50e423a05c8so32062441cf.0 for ; Sun, 19 Apr 2026 11:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622959; x=1777227759; darn=vger.kernel.org; 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=ninBs3EPIXxrGkgg3vUVv88i5W2pCsOK6agLZvll/l8=; b=QT0OjeJ4P3abBv2cRsyi06sgr6ZuJtl8TYxTXVcDgqVCsyOygrxklw/4a9zoPuiW2N f3O717RZ0qdeiKz98BfIYC2vRizb1u/6Bx+VlljYpDShNvx1yHZAIJ0pQ5dyteHRMa2a NFWI9TmiN3immj8/e478cAge6+qouzDvTjLRROZYesw+InCuNklArfZtUlt4dPlYb3pI LeaR+LBe7FK7cWlINg1TvDXP3r+VNqe6qfPMgVTfglygEFFJotJAGKI7GOohHv/jdg+N Bu0bxMFZbwOTBbfsFX4uj5DrPSGcuOXvCzLd044EmnJ6AlIbO9AP5CxOpvESwfyKkNcb g4sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622959; x=1777227759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ninBs3EPIXxrGkgg3vUVv88i5W2pCsOK6agLZvll/l8=; b=DVREScTUTHfPijGBQULv3HDnP2Mf59r6rzLQTq7GtoN3kdvXGQBGxbZAJ7vF/T9rp0 CffGkKEpdLfodbHnLLgb729jSq2hQArNS4m2fn7j/v5Vh1AJ5NbmftFtX7rDia2tGFQw G//mfvjJb74OwJ3KeRAU4xEOeFGmlrMkU8p39RrpFYon8t2VBGBn8/+0wfzu8e8c37iD SKH5IFDf46KX01YfTueNTMALHheQa4yg+tLV7zXXuum1ykvFaarlO0JOhAACV3LtL5rw jNO4Ogo03oofWGYkP/bf7jSiP/6a0iq9zebTV7dAJj3gXNX/bytyq/KJIayBEzQfPbna V0xQ== X-Forwarded-Encrypted: i=1; AFNElJ/7S59/5BwyqxrVEhqsMKhRKt4LziI3hiP0Ot/PA0jiDyRVYZ5+OCvOoFVgaIOJ9K9L8E+CUrvcd2aPtuk=@vger.kernel.org X-Gm-Message-State: AOJu0YxCDb3v5igWVhpKF3fkdNExq8/SSqkIcPZmPBxubkUOtbT0hbav tR+L1HEBnADTtKs2ogM3G1Fqc3+b4/QI9p8VDgpfGBuyvaEKHVP47e7Ie8CRp3IMOE0gZ8s8CTM Vdgh7PZ7DfTUBxcBzDeDtSqDnXvwz2Ur0HiuMC4/WDcGhJN6mlJz1oo51id4gLDdAK0g= X-Gm-Gg: AeBDieskzik5ChIDG+YhB3smODjPYbvQQo49EmZeYA2ByKlP3zAMQBtemHAiI26Nwyt d5xMLs34BqvRNc7SIcWlEHaCzQKU1DyILFUJty3xo3hv1ohRQAa201zklsANEbbR9jjGqTImfGV mclzQ4yo/UBw/LG09zgU+Kd+7IGW8UnYHSX1PfOh0BRJGk5NX/6L3yDTdLBenBYtgHkwLR0zOnq LpQyZmSo/xbXFngWAKU8VL30WX2MJm8GPGw+P85SCh8XHrKhN2a7OGb/s0mRapsNZMtYm14VIR+ JmfGW0CxEbovSa//9oOh+SODhoRV9r4BpW3+/gjZVVI5p2jDlQptD3Qcv5C3r6zo5px7goo7I8D eCvZ6cdWgiOPnT40GZ5sYjFQjHyuchL5PbxRWJyhP+sxcLEofIbepwV/iUOJj X-Received: by 2002:a05:622a:199a:b0:50d:84ce:e339 with SMTP id d75a77b69052e-50e36739144mr139764451cf.19.1776622958824; Sun, 19 Apr 2026 11:22:38 -0700 (PDT) X-Received: by 2002:a05:622a:199a:b0:50d:84ce:e339 with SMTP id d75a77b69052e-50e36739144mr139763991cf.19.1776622958329; Sun, 19 Apr 2026 11:22:38 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:37 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 04/14] thermal/of: Move the node pointer assignation in the OF code file Date: Sun, 19 Apr 2026 20:21:48 +0200 Message-ID: <20260419182203.4083985-5-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfXyR0GbQPc5t9e jscsQTxm3vMypnxXF0dSksh/MVDT/99yoUObodyA/6cDZSnqlaR5BtRzzQGX+Mza4rx5Sa2jVYy BczCUke9rG2fgtGkT+fRXYkulM/Nt0ySG4w40h99LlFnFarJFPzCosPXQFncULfkmcxZmqYeW2r MZP/s6wPCODt0B3GkzCWVcaZ6yKBBjw+W6ZEt2PMBHR6rPzguOK8HBbKpgoKwe7Fa/T+RNGVZK1 WOp8qoljgHrmGzO5vOp4KF6pBBnI0zfkxQBC7WQsg1YNZM6CBpOYke9YYCHGxhwB6Cicxux8Ksh xNMIi2YbJ3FRtWxwsV2x1uoEP3FdML8yLBYc4viIIUmLuBXGu1cRJ51ZRfDZpUrzHKtOmj6iCmw Cu1CYp96Ky6B2h/TQUqmkkguyLkc5h5MCoI0mgKUaYlRjsDZs96mW2HTvUC7GKT9goPIDXU4+oG fmFuIrt626pvI3xVAtA== X-Proofpoint-GUID: YuQ2tUUz-MZOueHTjO7t03NxaM4wLRmF X-Proofpoint-ORIG-GUID: YuQ2tUUz-MZOueHTjO7t03NxaM4wLRmF X-Authority-Analysis: v=2.4 cv=WK1PmHsR c=1 sm=1 tr=0 ts=69e51d6f cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=DEwMSQuYoAZka129e_kA:9 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" The node pointer being assigned to the cooling device structure is an action done by the thermal OF only and does not belong to the core framework code. Move the node pointer assignation in the thermal OF code. Consequently, the devm_thermal_of_cooling_device_register() can call its non-devm version resulting in a more intuitive design of the API. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 1 - drivers/thermal/thermal_of.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 35cf170f3fa1..26231acea382 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1089,7 +1089,6 @@ __thermal_cooling_device_register(struct device_node = *np, =20 mutex_init(&cdev->lock); INIT_LIST_HEAD(&cdev->thermal_instances); - cdev->np =3D np; cdev->ops =3D ops; cdev->updated =3D false; cdev->device.class =3D &thermal_class; diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 35d542aac7f8..85fc78bc9e73 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -537,6 +537,7 @@ thermal_of_cooling_device_register(struct device_node *= np, if (IS_ERR(cdev)) return cdev; =20 + cdev->np =3D np; thermal_cooling_device_init_complete(cdev); =20 return cdev; @@ -578,7 +579,7 @@ devm_thermal_of_cooling_device_register(struct device *= dev, if (!ptr) return ERR_PTR(-ENOMEM); =20 - tcd =3D __thermal_cooling_device_register(np, type, devdata, ops); + tcd =3D thermal_of_cooling_device_register(np, type, devdata, ops); if (IS_ERR(tcd)) { devres_free(ptr); return tcd; --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC7952DCBFC for ; Sun, 19 Apr 2026 18:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622965; cv=none; b=cFDb65dEXJORC5871OLMrACawQa08MNmKeW+jNjbMbDrhpFl/q180ZFexz+gdpNN1uzs8zhp4YUnQa4W5y+VeL8E1OrYQ+XmZlw93OyFZhAdANxlVZQAejHTB/qPz6zhMEJIdG5B4+eQ6Ps0ldEr2E40LPZ5BMCQlHov+zNlAPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622965; c=relaxed/simple; bh=4NqizYOexZ4No5CFQoDsrt2GHwnFslytgU20NXtygSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BQFjIxKCwX13zadgr6HqYlw/YTO4iJqf9BbHzCncKX5HJpGE5nSUx1Cpg2hwmHpMil53oJhhrUPgof1PLDfYtu2bT5fSh+pSuwSPw5ZAifIcmebL5Mao+4ki8FH4RY8Vtpb5Gf8RZKUZcPxPXwJShHurxA95siSBA+DmL8bWTd8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=k+R44qdx; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=C1tpKkNy; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="k+R44qdx"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="C1tpKkNy" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JFMrdG1410553 for ; Sun, 19 Apr 2026 18:22:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=0kc7vT/328x qBLbS3QbJUshzIFJH1U/NGm6u8XuhqhM=; b=k+R44qdxcDDNjUXbM+kTK65R04+ V78KnSgpLu4SdBHoXyuh3NqL/rhb+osXXm+XUmbE6aPjWCURgjXgYQ4TOnXVqv1H zl6CLVx6NhB2vv6kSe4dTFgTmsH1mMbFJmMIexXm4wOFkuHFthlib8qmqyVDy1+S v6voCKE57lAX2cpue4lJQcvT4hWoT9mcMHFygmQLTHhjGx6K8iBzV2233e2Zj1iu rXiqpJOs08F6kCPvfjWscz9/Rz1xVlaoiEUhyMcaU5YuFZL213jv1WopOpPh26rC 3eFfhWnDZazQbYeKnwlFp52VlW/QVbpCTbRwaWK+0QxB1W6im/BmcL2sXSw== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm21ujyrf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:42 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-50d58bed44aso18281481cf.3 for ; Sun, 19 Apr 2026 11:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622961; x=1777227761; darn=vger.kernel.org; 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=0kc7vT/328xqBLbS3QbJUshzIFJH1U/NGm6u8XuhqhM=; b=C1tpKkNyHuFJO4mUzq/Vy5Vl8at6FwnBVx1ibV5BRk5ymk6l88QnbHixJxO8DqVVyo q1lMOSlU5gDqW3HaMYSOavAq4cVQfrG16IQg6L37QJCMxK+7aFte2Yd9scXgg6hOMZRr l4ir7qQitjobIvXmztCTl8Fh0J7U3Y65mEAYjevJHSvv8lOttLz3M15i62SsYR3xZKAz cSv+eLX3ZMNSFaM+joyJVWBGFTlJuAlO9SLQAz06xSwZx5QBCb1b8vGqycd/1RJyrDFh 6T4sVF65R67wf5XhO5BbmCMNYROhukq6t2rqCgzpV1F9zcnuYQ6K/62RCV2v0L/HEgOV gm7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622961; x=1777227761; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0kc7vT/328xqBLbS3QbJUshzIFJH1U/NGm6u8XuhqhM=; b=cTHA+Y+PucUHJx2T0U7W3qcGT3MtN7IUv+iYXAuOjCpPe0NmqaXuPT+T8LgZswJM1f SzNaVJdpWcQV0pQAI83q3418ctPv5VPPyWwLb5Lb54lrZuCLa91YwtqlQpCn7ddfnu+L QEQug7m6Nz6X98mcOBY+NgNPkp5W84h1uSoA0BgBqFT3fCBbHETRCXl/CUmaESsmgM6x 452J1+/si3Tb95yPeJ31xfSTvXBFo5SA4BnjMXxVjYPA38scT8Jz8knWVsjYHkNoyGW1 K8heBG2QEAKKmIy0lLisFCMqOEhM2fzkHLfQXARKOPxnM/hla3Ix6VqbCId4GrqWOB8a Y5Rg== X-Forwarded-Encrypted: i=1; AFNElJ/IeDGOL74NAqYsbXo2LGQx1CwpBHAwj7MhRpbrSWqF76N9zSYZldDFdK8prZrIzcHf7FnGEj11XDWDNYc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7kQ593SyHSmENE5yWlpau9n3ZWk8h9BzPJEfu5g5OJcdSuwqL t8rCgVbkkCKjYz6BWgRdWUPTrqdZgVca+/r4FS9qxc6P1F2NphmkQ7e0X6WkJN2GmC8hWP7k4lb tFy9iJRV93nqvafQb0qXFvVeqPZ0DgGH4MuZWTQOzTKWCTt4iGoDtteCjiRJHML5W1Fs= X-Gm-Gg: AeBDiesFxQarlx6En5jBQPV+nTgyY2VF2zjfctErdGt0yNyLwOm5kAUZGZTVBj6c2M7 GbgrMVtPYqh1R6O/ul6JfTGl6vVtpZA07uBo7wLHQ3HuHcZEg/EEwTyaiHgXCf4mPSNIhUwmjqp ucmYHUjAN13Cicrm7d7L6831nspHT0Ibx34DmaMERlHTjJNzykNNCWnZS7Ry12x5p5DslIjqyo2 gOXUFsfVygWBQdq6SmMvM+oucq1yzVOzuS0QqZpz8bj0JnXynqJ+fDuY/0IpvI4XACH0mI5X/um onnyWU7sucEkw+T/YNpxwNablY2gxx5pdppCp4vd+efBzW/Essq6cAvHnzxrvrEsCg8Wl4CcOxU /QkZFkWasdsQO3lE70f8iXlLBXOQWSB74mF9zqCj4P5La4xmQypmAK23KNzTd X-Received: by 2002:a05:622a:ce:b0:509:238f:ad92 with SMTP id d75a77b69052e-50e36b5461cmr163959121cf.24.1776622960951; Sun, 19 Apr 2026 11:22:40 -0700 (PDT) X-Received: by 2002:a05:622a:ce:b0:509:238f:ad92 with SMTP id d75a77b69052e-50e36b5461cmr163958831cf.24.1776622960436; Sun, 19 Apr 2026 11:22:40 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:39 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 05/14] thermal/core: Remove node pointer parameter parameter when registering a tz Date: Sun, 19 Apr 2026 20:21:49 +0200 Message-ID: <20260419182203.4083985-6-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX1r9Mo3+/CD0+ +vQaH7jGklAL7lpvksEjIdMitrjEsNmK84sf5Amd3VhNa4z5tzXg4/34HROyRHfKhWvu+oRq+Wj B7khpqV8FgVmklniRVka/0l8HQimIKG8sD0SRejg367urwaRieKql/HRG5aFZYLWunYKIhN+OHx OXtqOeqvl+m4oIMxT0x73YCs3fOto7/RdOj5aHz/rfKzk+TOVO1arkdV/Dnk3JgQ56sHAYbnm8S i0OpZEIqYuMeQ072p169Y3OMtaryQDTg/hFVYaa3IEKYJnz8/ZZ01HLwQEJE77ll9hrlZOI2FfU /Wf7xEohnfxb+cxS9F3t5ZYi/a2Z908VfxBOkzoF7I0pevVrKO0oGfzC8PdL7417Bbs/gnn5OvO 9mrZexvP+Y8YwuDxJ3dxFG+hJFHNRdLgW4+CZNlfjLCB8HyPqHSkQHRjxfgW0Ka0K/YVA/xltmZ uHQ3WvNtRMySRPdDDwQ== X-Proofpoint-GUID: 6j3Z-z3jXSG9vBUexdkSi6IdS_pYFvop X-Proofpoint-ORIG-GUID: 6j3Z-z3jXSG9vBUexdkSi6IdS_pYFvop X-Authority-Analysis: v=2.4 cv=WK1PmHsR c=1 sm=1 tr=0 ts=69e51d72 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=ggozHacZmVhwqr8k6bIA:9 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" Now we have a OF version for all functions registering a thermal zone or a cooling device. Let's remove the device_node pointer parameter in the core function which is inconsistent with non-OF code. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 6 ++---- drivers/thermal/thermal_core.h | 3 +-- drivers/thermal/thermal_of.c | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 26231acea382..2f5d214d51a1 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1042,7 +1042,6 @@ void thermal_cooling_device_init_complete(struct ther= mal_cooling_device *cdev) =20 /** * __thermal_cooling_device_register() - register a new thermal cooling de= vice - * @np: a pointer to a device tree node. * @type: the thermal cooling device type. * @devdata: device private data. * @ops: standard thermal cooling devices callbacks. @@ -1057,8 +1056,7 @@ void thermal_cooling_device_init_complete(struct ther= mal_cooling_device *cdev) * ERR_PTR. Caller must check return value with IS_ERR*() helpers. */ struct thermal_cooling_device * -__thermal_cooling_device_register(struct device_node *np, - const char *type, void *devdata, +__thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { struct thermal_cooling_device *cdev; @@ -1158,7 +1156,7 @@ thermal_cooling_device_register(const char *type, voi= d *devdata, { struct thermal_cooling_device *cdev; =20 - cdev =3D __thermal_cooling_device_register(NULL, type, devdata, ops); + cdev =3D __thermal_cooling_device_register(type, devdata, ops); if (!IS_ERR(cdev)) thermal_cooling_device_init_complete(cdev); =20 diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 6e44bcf37b00..d45455bb9e9e 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -272,8 +272,7 @@ void thermal_governor_update_tz(struct thermal_zone_dev= ice *tz, void thermal_cooling_device_init_complete(struct thermal_cooling_device *c= dev); =20 struct thermal_cooling_device * -__thermal_cooling_device_register(struct device_node *np, - const char *type, void *devdata, +__thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops); =20 /* Helpers */ diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 85fc78bc9e73..3d2fb8f37b9c 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -533,7 +533,7 @@ thermal_of_cooling_device_register(struct device_node *= np, { struct thermal_cooling_device *cdev; =20 - cdev =3D __thermal_cooling_device_register(np, type, devdata, ops); + cdev =3D __thermal_cooling_device_register(type, devdata, ops); if (IS_ERR(cdev)) return cdev; =20 --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B836C2DF6E6 for ; Sun, 19 Apr 2026 18:22:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622966; cv=none; b=AAb0y69QXH+56Zx38RdxdwW8QtrfV4Id1q51VClkQHr5aSzV2gwH852WqdaJtdbmvQMzRDrOMwSbATSlsFhsKEseJTaJh3FjRONVgrUNRlSlhpchPR9IHDTUHR1ZiTEnyTkoqiPE/k5YH+bMeLIchZPj/wjN669UvP7Fxl5um58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622966; c=relaxed/simple; bh=QFEKU97eqvDA0QMBKvkfQSYoQ7Mbh0z7Y4dUY+CpPEU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yb5R1zG+lI4NertpW0U0KM/gyaMbaGHCr9cfjozc2yuFxadu56iVQsYbHLD54ftXZg3SXnBn1ufiprEz9QrKsRV8kY8cDZyRCYnfv/1LWh3s1U86/w0xbAVrnYHcxaYqCBi2SwSLbi+irmHVf2iSBI/1fQlsyLxjE260VaKRhKE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=HY++AqGA; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PcBZ2F8J; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="HY++AqGA"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PcBZ2F8J" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63J2sA0B3971063 for ; Sun, 19 Apr 2026 18:22:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=8SJc8Ox6w4Z ygU6cO3C5yCKbel/yP+52HnTiIJQrGqw=; b=HY++AqGAu74IXd8c8x1L+F7ZUqR lSjqC6zchyrO75jh2vj5B0BDFA3hUtW8HeUBr5WYz304QyHcwWy4d0e2C0QbXWsb hZc5qNoJTXpvgjvrAIA7XBiPlpKm2ZSNREJ6jefmfD2CnIXm9ZKjHhAUB7ko2Pzo fJxACJn3JlGs7md2/McoajKWFq6r3HZTS9jB+HvCcOwt8sr0SdTspnSXEncnuG2C HfjgWZltexqh5UreiST4+FSyDloBAtZhTZPCQljgBX6o5r05dGjC4Nxp1whnFs8s z/gLn8qA/tzx/dyAz4uRiiu31feEDXP3uZGUTukZs2Wi7/CVsS4NS9btXGw== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm19fu30k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:43 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-50e423a05c8so32063051cf.0 for ; Sun, 19 Apr 2026 11:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622963; x=1777227763; darn=vger.kernel.org; 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=8SJc8Ox6w4ZygU6cO3C5yCKbel/yP+52HnTiIJQrGqw=; b=PcBZ2F8JSu++3vfOirU6VjiJJtwQVI+vnh6da3EA+/q+ZpSdAHHZB9PlxQTGJ4uvmD wR1S7bf4Z1+Ldet3DS9F9RNwwSXS8eDj2djKIVXSh209u1LXgCAccmPnw+WFX3WqnS8j EzzWEBy4XW9iSwwQ6ocdC6QkwUT9R8Sc3eMyD/fgOTFcVmTTGnXDELNADBckz0a88yWH fh/nLqFsnCoDAfGztIZ0Jdl1ebPyXtGMPokvH+Wqwy+fhlZsDy4wiQ+ykfgUXCOp0sSJ B71tK673lPfkjXFyptEZtVadRtXxMgJmK4pp1risJ8Iig3sX41SYP7vBCx1zN12SEZQI 5KiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622963; x=1777227763; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8SJc8Ox6w4ZygU6cO3C5yCKbel/yP+52HnTiIJQrGqw=; b=HYanu4o1Vpq4b9e+7GeaqMFVuzhmipnFuzEPu0UcdYtje0zUbbgKFXsxCzsIR/1xZj I1usRPLqxeJt49warHyevoT9S9byqHfhBpXVTvRyIckRsYP3LdCUfGdRpE/SJz5KTXHn xCywzySDeBYGdmKXh6cQODscNBNJS1dCP9wpKWnjV0dQpobZzEht0mNzFsNbecTXU7Rh C2HXqziRDMZxmB08MU8zsBnsiCF4KbUyXqlPHZONybetO212PBjH8Cw3dqQUc1kOV9Ua OF6rfFLxLT4gYx7vj8WnbmX9zbsX0+blD+HEQzaDCtzdeaNu1SuvOlTTIC6L3Oh615Y8 sYnA== X-Forwarded-Encrypted: i=1; AFNElJ+bPGmStduWrL56wIllO4iv1J5+zPNFv1Mid5KgSECX2F3qwwIt3XZxOcF7JJwRMb3sMrar1b6UqbvfJy4=@vger.kernel.org X-Gm-Message-State: AOJu0YzRyA+NVIPW47OJt1Pxrdaa9NQNvTdvCNrId/srpbrEs7mALzey tKIzoLpWyxdVc+3oUuKzJNmf2OKCw5TTj5VpDn2Yt3F/QOekFaVW4n20i9d7CCU8jmTHEhBYQST sSjL998mLt7iUC/MVHUJBShO3SBHv14Vo9Tl3De7/9ddLWFS+0dss6sABqNrMMl+7pxQ= X-Gm-Gg: AeBDiesaquesB0pmabrrQQwQFV6zvCYWIGJ/tFcu/hcfHCag6uKfthovFmNDGRAW/y9 /FIRJKBYvSMMPh+wQgW81ZxHZv6+zkK2GjPjjVzLpLN8qGsib5yNiEQogTm32zTgSpWB/yrL3ol cbxpt/D20I4n2P1etS6gg+VkZqImoFGJUwy0iGUhMRubtSJQnLF8CL2p22DtmpeIVyD6h08LZIB J80vyCaYVR1FU+aVgZVd/gaqDC17mo8uXV+Od77olEmmnK6q9MvcbgTJL7kguq5o3sxzm+xUXsv Qs0Mq+EtmLEuFIyYohP9OdSM3Jm0zGbQWAvUNfcEY6x1aqmoumpXV2CW9u0pEIQj04t9fYufnug cCANU0Fc2iaH+UwxDgGa2RGw33xEKMGsIzoWYsPlSZpEbREXGkg89wWaYaFKi X-Received: by 2002:ac8:7fcf:0:b0:50e:32cd:52fa with SMTP id d75a77b69052e-50e3661d434mr140438721cf.3.1776622962822; Sun, 19 Apr 2026 11:22:42 -0700 (PDT) X-Received: by 2002:ac8:7fcf:0:b0:50e:32cd:52fa with SMTP id d75a77b69052e-50e3661d434mr140438211cf.3.1776622962349; Sun, 19 Apr 2026 11:22:42 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:41 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 06/14] thermal/core: Register cooling device non-OF drivers Date: Sun, 19 Apr 2026 20:21:50 +0200 Message-ID: <20260419182203.4083985-7-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX7XWomikxzn2g kK27mMQVNurLcMO3xkQgv6c0MknBn+iUcjhT81FF2C/UFRAnb4RxjsiBoA44ybnDH/bj8igGSaZ GwtiRDUkCP1TB0S3m2ZDGjHobaVEl9fjyXoC4AdgZOv4Sosblr0tU8PzM2T1TcaCpelpBLtdQf5 irNitWYtl0Qx5aD1TFnQIAdLwmA7g0pll0ljHA4Bnx8R32ZuM6XuKPEEmop4on7reH797eRGZfx H94Y8RfSvaEYQobwd1i5vnLSpIcU1Hjku1zz0w04QQZ2pS0J461qqBVX57N6rtI+k9gEKYYPVrp O7YcrSvgwcm8QTp4mdRI2AdNegyyEHcKXcrChnM08Pi0ZElYgC2/bzogfVu+jIkcpIaN4JUyema R0DP5rylytRrp5zaXZEZAmqVWeDPA4n/tjT+jvlqAxsl+UjxnGsCL1iILYGwDMD9inl6d1IxGGh Ym9mQ+Gu2xZFJxGPW6Q== X-Proofpoint-ORIG-GUID: pa2sVTuJysgo9q3JiA43cH7buxeyxvDq X-Proofpoint-GUID: pa2sVTuJysgo9q3JiA43cH7buxeyxvDq X-Authority-Analysis: v=2.4 cv=FMorAeos c=1 sm=1 tr=0 ts=69e51d73 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=axTsjYC8yfnw0r5e9iIA:9 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" Provide a non-OF functions to register a cooling device in order to have a clear separation between OF and non-OF code. Drivers not using a devicetree can then migrate to this function. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 44 ++++++++++++++++++++++++++++++++++ include/linux/thermal.h | 13 ++++++++++ 2 files changed, 57 insertions(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 2f5d214d51a1..356a49e541fd 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1164,6 +1164,50 @@ thermal_cooling_device_register(const char *type, vo= id *devdata, } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); =20 +static void thermal_cooling_device_release(struct device *dev, void *res) +{ + thermal_cooling_device_unregister(*(struct thermal_cooling_device **)res); +} + +/** + * devm_thermal_cooling_device_register() - register a thermal cooling dev= ice + * @dev: a valid struct device pointer of a sensor device. + * @type: the thermal cooling device type. + * @devdata: device private data. + * @ops: standard thermal cooling devices callbacks. + * + * This function will register a cooling device with device tree node refe= rence. + * This interface function adds a new thermal cooling device (fan/processo= r/...) + * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind = itself + * to all the thermal zone devices registered at the same time. + * + * Return: a pointer to the created struct thermal_cooling_device or an + * ERR_PTR. Caller must check return value with IS_ERR*() helpers. + */ +struct thermal_cooling_device * +devm_thermal_cooling_device_register(struct device *dev, const char *type, + void *devdata, const struct thermal_cooling_device_ops *ops) +{ + struct thermal_cooling_device **ptr, *tcd; + + ptr =3D devres_alloc(thermal_cooling_device_release, sizeof(*ptr), + GFP_KERNEL); + if (!ptr) + return ERR_PTR(-ENOMEM); + + tcd =3D thermal_cooling_device_register(type, devdata, ops); + if (IS_ERR(tcd)) { + devres_free(ptr); + return tcd; + } + + *ptr =3D tcd; + devres_add(dev, ptr); + + return tcd; +} +EXPORT_SYMBOL_GPL(devm_thermal_cooling_device_register); + static bool thermal_cooling_device_present(struct thermal_cooling_device *= cdev) { struct thermal_cooling_device *pos =3D NULL; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 0ddc77aeeca2..d9332b037188 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -260,6 +260,11 @@ devm_thermal_of_cooling_device_register(struct device = *dev, struct device_node *np, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops); + +struct thermal_cooling_device * +devm_thermal_cooling_device_register(struct device *dev, const char *type, + void *devdata, const struct thermal_cooling_device_ops *ops); + void thermal_cooling_device_update(struct thermal_cooling_device *); void thermal_cooling_device_unregister(struct thermal_cooling_device *); struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name= ); @@ -317,6 +322,14 @@ devm_thermal_of_cooling_device_register(struct device = *dev, { return ERR_PTR(-ENODEV); } + +struct thermal_cooling_device * +devm_thermal_cooling_device_register(struct device *dev, const char *type, + void *devdata, const struct thermal_cooling_device_ops *ops) +{ + return ERR_PTR(-ENODEV); +} + static inline void thermal_cooling_device_unregister( struct thermal_cooling_device *cdev) { } --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 682742EC571 for ; Sun, 19 Apr 2026 18:22:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622969; cv=none; b=SSwB+aB8DSjeop2x6S7rwUlLdsyBcPDGpX4aAypsVhdrMpd7tjKD7XNyWloUXX4meK77JLpTLwmglRrtfo6v8pZmVHXOg+PPXOwwoBdeYHevvRfCC53JHkTLBklNzAf2Kf8WwbER8AH9ur7sXLG6uJMUe+n1Fkv9n7hUeanI8/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622969; c=relaxed/simple; bh=x2HKTjy6kA5084gb2G+glaC9oZCPA24Zn7jOFG52TSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b6PmhGQ2Tog/R+U9Xk31v3fuqieGRgiz6U+LRLH7IvoHvTh86Jqx16k9iOnH0MKBudHpVLJvohbUK93WlbhXzi3n0lc/aShRSk8c8kEP3YnVaUPxPb/7A2x4KITNTqeBAT2V+WLo8DZ+tPFmL4+RuykFx+EUtjdrdtFuef2063M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Hz6ymiwa; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cWWVu11T; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Hz6ymiwa"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cWWVu11T" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63ILmI493368138 for ; Sun, 19 Apr 2026 18:22:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ks9AROpzFl6 d4jF1iHD/p5RckBAUeQlMs5t0zXMHyzk=; b=Hz6ymiwaIWjaYjEIZWjFoeJbzrQ LKjE2R7S1XW1/u6l4dPrXPMhbwFl33qYnHPWK4DgqD8ClwFlKweOtPMdbSmSAHAz 8P4BAvHHwe3BLq6f5MFCNhYYMVTxriEpeaGvwze8FxW5NdCokbb0ns89Bz6mxrCn H/RJsK762nGVyud3/F5P4O0sHBv6D05347TLNanP60Fv6s2rEmTSJjB8NZW0X3pe kCVZUVFWe4UrOha4++JGGklQQCQM3zbgA53D5JYwnVn2o6Msc2dr/kS0StXeHAoj 6fX/jinuTmVEmI/IvimiDybLo45dKJ3ai38bbqfxm5RdqpJpYpwgbS4A17g== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm19fu312-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:45 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-50d9a6a853bso58728931cf.0 for ; Sun, 19 Apr 2026 11:22:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622965; x=1777227765; darn=vger.kernel.org; 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=ks9AROpzFl6d4jF1iHD/p5RckBAUeQlMs5t0zXMHyzk=; b=cWWVu11TPSGQDoR7NYw8rVnVpP/QFde1toOo1GqUPqy0fzNalv2ZHdyBBReY5/NwzW fR/IE6vEcvEXYdb3SoxFPIKM34bZzkrRCgxjn3f9RGC52lR/AZ5uxZTlIPIHjZWSXBiR PqtjDK+BUyzaA+Waymw3LL5VnnnCuNrawABZni6SSDr/Hd5sXuwgprTcqNkhdGLnTb9c bgd4nXOJfOzD+pHgv31LXWGW1vDAk1P96gCyTTbiZGzr1HsgMixkULiIoxe3NPlQSxO0 g8mADAZ0tH9Nz6EOnPVN2XmjuCae0NPZV/qTLR7VapQ+Q1BFp1oQ3vi9vpZ3Coq932y+ ZgZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622965; x=1777227765; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ks9AROpzFl6d4jF1iHD/p5RckBAUeQlMs5t0zXMHyzk=; b=CPrimrNbhFi/qrNKepsqIaBgwpLau1a9uqlu9FAbkp+lgAZyr1o0Flvort7iz9S9/V Pd8x26KWPDzH7uTth8ly5qrewODdE+6ArwwAi7y/AlZs0qiLyQTIGMzM9IMv12NI06aQ RaGV1EdHjhL/tACtRNu9wDrs6/ItWo30TskESVlC23YDvSVyh4LwXPpvuQWBs6TPhTSU 7bpK8Kr8xZTwTJ48OvtXPgHVFXqOfdQnoojZvarBTsKU9jUJnMXnxhGeeVWSkKmFlKcd 4B7ac+wA7pQqAsl3Oszr1y7wigWLCamsU8hPeiI90EhwTaawV3u3fCbmR6yrads/WKWX VfOQ== X-Forwarded-Encrypted: i=1; AFNElJ9DXAsG+PiizLCwKnq8IXKFWiK4PpCTaEMmgN6fUhY5E05DliMDiiXXwHjjuwj831vSmgw9+TBXzakUpB0=@vger.kernel.org X-Gm-Message-State: AOJu0YyzfXpQiIoG3WMhsfpnOKFBE/B2gU76zl9zG5TverPPtSLulHwA gxmeO+e++dIXWmhmDxaDVC88sAgWOYSpDukj/Ik2BEcrFgSfYkIiY4/F5udOu14H2wbg96HXfZ7 wykmMqiCSZiKa5dBG5QwetYWD8lbyvr8NxaSIqRFFtwJlQuGrpsHWH/c6pSxlhrK8BQ4= X-Gm-Gg: AeBDiesX6Mco171xqGQPNF4AiIGEI2Gpv1i/eJfkEW0RzuprIVO6aCfL6R/NNRm9sfh +grnvLKIJxWxNylTZeqejnrL+gyGp3znZgekVpPTcFpgfjSYz2u6FFY2+nv0OOUJrPVfD9Sl7yW Msa32r8O6rXvu5VfaOmWIEmgJXjv2ejbvTkXaxZU9JXEvxJl99OoDPOq3+vTTsupDw04CH/96mW FwLRKEXNUUvL/CzUwL6pp9YMFgk5Jw4msuYF/SK2rL8plycoWYWrjUOPX2lG/XSVo89VDdxkfkC K3qejyVJGjhMfne6XSHv60zxCr0+eEyNGofXYQHylkU9BeLjmptUyJ3wW1btv387le/tO18hc84 E8GUri9fl3vusM3os6rOk2iLkWM5qZDsMqA8eHbZlaZa+KflB25WVib8P3Ryz X-Received: by 2002:a05:622a:1820:b0:50b:4a84:aa94 with SMTP id d75a77b69052e-50e36b86249mr168984881cf.7.1776622964817; Sun, 19 Apr 2026 11:22:44 -0700 (PDT) X-Received: by 2002:a05:622a:1820:b0:50b:4a84:aa94 with SMTP id d75a77b69052e-50e36b86249mr168984181cf.7.1776622964258; Sun, 19 Apr 2026 11:22:44 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:43 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, chrome-platform@lists.linux.dev (open list:CHROMEOS EC HARDWARE MONITORING) Subject: [PATCH v1 07/14] hwmon:: Use non-OF thermal cooling device register function Date: Sun, 19 Apr 2026 20:21:51 +0200 Message-ID: <20260419182203.4083985-8-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfXypG8IU5rihRy /M7v7Vm2LFnOgCGy7uqe9Ig0xHFuE8nynv0cgFscUnOqyYCz0/7xwzMOHFBGgeOlbvSz9JnAEbS g9+Vx7/W6NqdiVSZRNurr0rXorPRomMgSg6QWjYNkykl94NWJPPK3TnTzEz4vY8XygYEXmBWddD sa5KlKb2uqG+4ZguVrZZ1p5bI+uwqk0AZ6E8IdhxyYdVptyIRAkcYQXJM7KkhvTlTs2zHEBO/HS o69CtzQhijf0PWkguE8zDB+DKB9FERESo/oNAsrbXxDTlDL5qkst3MedX0giASV5DWxRakMtPzm CjzkBevwRCMJA8T033ArreQi/qTZpnIX5JXCB5+9s6eUdlpV98y2Q0Dg7rGWn3kAufhZrd71UR4 N/Lz+Sm1E4nP5iaze8yCqUqGtdy/UOwNs+yTxLPrjGOmbNFmOrGEQu844HObQ17An+1KaQKADcj F5/KI9vnIp0+dZ4yGWQ== X-Proofpoint-ORIG-GUID: KIqpX90ljpsyYHTyAqfvOlcRsB2TwsWW X-Proofpoint-GUID: KIqpX90ljpsyYHTyAqfvOlcRsB2TwsWW X-Authority-Analysis: v=2.4 cv=FMorAeos c=1 sm=1 tr=0 ts=69e51d75 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=ggIEzLyBpZPC2L1Vao8A:9 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" Make HWMON drivers which are not based on device tree to use the corresponding non-OF functions. Signed-off-by: Daniel Lezcano Acked-by: Guenter Roeck --- drivers/hwmon/cros_ec_hwmon.c | 4 ++-- drivers/hwmon/dell-smm-hwmon.c | 4 ++-- drivers/hwmon/mlxreg-fan.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/hwmon/cros_ec_hwmon.c b/drivers/hwmon/cros_ec_hwmon.c index 6cf5ab0f4b73..77dd9f28962d 100644 --- a/drivers/hwmon/cros_ec_hwmon.c +++ b/drivers/hwmon/cros_ec_hwmon.c @@ -532,8 +532,8 @@ static void cros_ec_hwmon_register_fan_cooling_devices(= struct device *dev, =20 cpriv->hwmon_priv =3D priv; cpriv->index =3D i; - cdev =3D devm_thermal_of_cooling_device_register(dev, NULL, type, cpriv, - &cros_ec_thermal_cooling_ops); + cdev =3D devm_thermal_cooling_device_register(dev, type, cpriv, + &cros_ec_thermal_cooling_ops); if (IS_ERR(cdev)) { dev_warn(dev, "failed to register fan %zu as a cooling device: %pe\n", = i, cdev); diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c index 038edffc1ac7..47b373ea6db4 100644 --- a/drivers/hwmon/dell-smm-hwmon.c +++ b/drivers/hwmon/dell-smm-hwmon.c @@ -1161,8 +1161,8 @@ static int dell_smm_init_cdev(struct device *dev, u8 = fan_num) if (cdata) { cdata->fan_num =3D fan_num; cdata->data =3D data; - cdev =3D devm_thermal_of_cooling_device_register(dev, NULL, name, cdata, - &dell_smm_cooling_ops); + cdev =3D devm_thermal_cooling_device_register(dev, name, cdata, + &dell_smm_cooling_ops); if (IS_ERR(cdev)) { devm_kfree(dev, cdata); ret =3D PTR_ERR(cdev); diff --git a/drivers/hwmon/mlxreg-fan.c b/drivers/hwmon/mlxreg-fan.c index 137a90dd2075..860de6cfd8a4 100644 --- a/drivers/hwmon/mlxreg-fan.c +++ b/drivers/hwmon/mlxreg-fan.c @@ -583,8 +583,8 @@ static int mlxreg_fan_cooling_config(struct device *dev= , struct mlxreg_fan *fan) pwm->fan =3D fan; /* Set minimal PWM speed. */ pwm->last_hwmon_state =3D MLXREG_FAN_PWM_DUTY2STATE(MLXREG_FAN_MIN_DUTY); - pwm->cdev =3D devm_thermal_of_cooling_device_register(dev, NULL, mlxreg_= fan_name[i], - pwm, &mlxreg_fan_cooling_ops); + pwm->cdev =3D devm_thermal_cooling_device_register(dev, mlxreg_fan_name[= i], + pwm, &mlxreg_fan_cooling_ops); if (IS_ERR(pwm->cdev)) { dev_err(dev, "Failed to register cooling device\n"); return PTR_ERR(pwm->cdev); --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E6842F12AF for ; Sun, 19 Apr 2026 18:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622974; cv=none; b=odv0EuuqY9Z0qz+cLCx/lp1bYdYXGQEyvNkvmb6CBQ3CiRJPljBkljJwViceafVNKwBLWtjoExyb0Bk0QabcWuB3QEKtoY7zBAubJCaAnqtbyEcNyijfvKmPx42JiMjK2WImX7Va7G+dbNtaDotx6JeP+2Nx4qwz0yO+ElXpMP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622974; c=relaxed/simple; bh=1EZJ/sEXs43bbTva6IXmLEChVaaD4wyyFswaWaokE1o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mY14RNoO1ctVM03Vkc6AZlynbDtlWRiBoBViyxxD48jhyZ5QYpQjZMHjJR2t97qPsOoSDPwzexofBqhAKcbN007QJCnI+gzGjLuJMojagVo4Hblfs5r21orn/HQXOQPfk4og2FuSpmaff3E2qqMdtgRE4l5goomKdB88tpEaS14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZlX9K/RV; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AwsOi66O; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZlX9K/RV"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AwsOi66O" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63J9mG3v1843753 for ; Sun, 19 Apr 2026 18:22:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=5+FaPlCHs97 hjeDgtr8xUv7bicqdWzWnDvhYFxD5bkY=; b=ZlX9K/RV4K7ZZOXAZiRJu0f4RC6 8M1fINuzlF7+36gLDxgd40+YCs50AnOhem8rY+nPcwr3ZyTJsp7nspp5hUlibtF8 JlAlvUA7Tie3jX0gYd2SfHHytIgU1ZCy7OdJSEr5DzsbNoVQIH0yDEIn6CaYsk6+ ZnDCDBSpk7tVwp+dYqA5eXX1v8bZ7cuZzXGBiPWjCY0eYSKFJNIn7ksk/hXA+rV1 N6joJD/ZM6Q2dX05OkwE2NFH8d1ytcynP/BspS3iHSstOcKDcCT9OGKKuaJxqQ1M IN3E02DKfvLFTdTPgeYsYMxfMWgXEjCsYsZ89UCL/ojMV7M3pdqfmZj1Vfg== Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm388jxg1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:47 +0000 (GMT) Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-8b0312bb1dcso45775296d6.1 for ; Sun, 19 Apr 2026 11:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622967; x=1777227767; darn=vger.kernel.org; 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=5+FaPlCHs97hjeDgtr8xUv7bicqdWzWnDvhYFxD5bkY=; b=AwsOi66O981F/StI/ueQEd6oewfOBelQDBSTtStxF+mGquLFa8pCieSorYBCnYg7w7 x8DFCLUT8E5fi/VX/kskD+VclHR898xdXA0zaTlaw0/nObI//vmj8eGvXV2HdRe88E2u D/H86WZo7Th1oyjSWpC8u1ns1pDHe4jn0LFhYOjtTuWtq8jBaMeK8edAd9/oBobq1CUS OIjWQJo0k/FT6fIchjnCWRr88Obe00pK0wnZRrUUmtoUXr/yIxUc+C4zkBRRgbFLRCfG W0VBAZg9xkmgL3Pfo2gTbkTovSXIOrYp3WB4J1x0Z2pz/iD2Z98ICTSR+qC8AsAbiQ4v WSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622967; x=1777227767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5+FaPlCHs97hjeDgtr8xUv7bicqdWzWnDvhYFxD5bkY=; b=JrAst/MwBNxLT/UdZPRHKwc2pr144xkWA84nkXiJlBT3P6n5OCk8s1ipQUAoGSDRmc lsAmVkr4p3QTB6eSQrR9lLGgeiNa4zdJYbUeHM3PGLQPVS0T7Hn5fsEDdLH30pCUGD1s xtY0VfmRDrVGHXw3tnnvB8DbMN8OKvLwpGs8OSdUHRp3jJXZ1iXYYrrNLiAfTThFJeo0 q8KdY+4TBi8L0ShkOUeP8l0Vi8vrzTqkMaJSbY4HBu5N4KvLS01rD6O/tiaKxsL9qlF8 UqM653yy3MT4bKjmjClvECERVXpObRWrCXqsrm+PPXXGcX+rH+t13Nice0Miuia1t5mF jmUw== X-Forwarded-Encrypted: i=1; AFNElJ8oYT7Y4tm8/vKrutshjm6fqp8+TBd3cRMd7jin50wzpAJJ0DMYDGA5o/EgWGat70OJ3Bt1XuksHCeiXu4=@vger.kernel.org X-Gm-Message-State: AOJu0YxK1JobAEk71zh8fPAxKPqArU9iepwqU66CeSi0hKf6w713kjzd f/sK2h9SQHNcul9ChaQlbFMawZ6OP3n+mVlINDupnKJ1tb7InikwMUypnbGqajDnF8AerX8PbX5 lQVPPrpWxNuS3nxPYOMZ3hJzk8lTQU3JBomoS1M0PtbSJuX+BaYlovW1WslKVLSsyB+U= X-Gm-Gg: AeBDietJ1YpZpgaQ6NkUQx+TWp/XB8NfDEnPIj2w2/TmH/JvqK7pugzLier5sfj3n1j xV+157feIg0jJxFpRdA65L/3iFYqYrX93A0HBSdnndbspLJSkd6hiBK0wpXmg/V5BVo4yjLf5ed PYTXOg8VZNNbYBNG5xWXLG+smXT/E7fLhU4Hboghng1W3GQfSJQAWiUHBd591tjjCM0JmbeWkrE C6GHxnQ4qOvKgP9PkfTEU6+yV78JU15fbqW89Amv/GKs1FFIKqF2cxkxm51kJeTrglC3W0ZXNFv RnExOlpDMGWXL0tCMjdErI+Zxvrh3W+CDJStyVkO7BXxzdFd674gGsg3/PZdm1u4klVceFLRuE5 VzxCZrjUZ/V978BTU26NMbRfTZWRtwEq62nWJVDcwLDkTvqWIm/sr7aADf0rD X-Received: by 2002:ac8:5953:0:b0:50b:3831:417f with SMTP id d75a77b69052e-50e36c773b3mr168851411cf.45.1776622966658; Sun, 19 Apr 2026 11:22:46 -0700 (PDT) X-Received: by 2002:ac8:5953:0:b0:50b:3831:417f with SMTP id d75a77b69052e-50e36c773b3mr168851021cf.45.1776622966149; Sun, 19 Apr 2026 11:22:46 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:45 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 08/14] thermal/core: Move OF functions def in the CONFIG_OF section in thermal.h Date: Sun, 19 Apr 2026 20:21:52 +0200 Message-ID: <20260419182203.4083985-9-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=GthyPE1C c=1 sm=1 tr=0 ts=69e51d77 cx=c_pps a=oc9J++0uMp73DTRD5QyR2A==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=1wpLYamVcWg7q6lobrwA:9 a=iYH6xdkBrDN1Jqds4HTS:22 X-Proofpoint-GUID: fn-VPRSFdnDAASFD2n7YY6DhDUL5lY7l X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX7rRxk1OPd6zf /n/cl2Zde1KJkD5C4V1EB53TJeIApFReIXCcKCTWYf9P9xm1GABj8YjlhTw0c/l5ZZVOirgeIfb FK+qzPejfN6PhEp8BJH02p62+i4mfkEMcg0jYxa1TNJuRil5PFbVe96g/9Qc1SZ5Aqd3Qu3//Sj 96f6ivLMFJ4zU5hipCyDzdgni3KjB+CAmcpO4mohkhIdUN58+HsyYWMLauj7O1i0L4vN496e3Iv 7rLjy2+9hXmu0BAeEOSd6D/sKWcImEbmA06DNNVl0F6xBzAtHLpB/tesDUeB0slZxAelB4qFFyi CML5zKpdyYXR8X/1JfHCM9knU4/xhxKebeP7HLBCu0hnhJuBb+B2ObNgMRWEPlHzPO9WWn8da0M NxpufrfchHgV1+mOddexAD6IZssY9X0wmRFO+w5vcXqgi+q74jok/qs1/hPuv6S8ELdEOea9MGt 6QfQJrSEYQwi8CRnWqA== X-Proofpoint-ORIG-GUID: fn-VPRSFdnDAASFD2n7YY6DhDUL5lY7l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 spamscore=0 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" Now that OF functions are used only by OF drivers, let's move and group the functions definitions under the CONFIG_OF block. There is no need to keep them out because of non-OF drivers using them. Signed-off-by: Daniel Lezcano --- include/linux/thermal.h | 48 +++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index d9332b037188..f7b8651c1ed0 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -198,6 +198,16 @@ struct thermal_zone_device *devm_thermal_of_zone_regis= ter(struct device *dev, in =20 void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zo= ne_device *tz); =20 +struct thermal_cooling_device * +thermal_of_cooling_device_register(struct device_node *np, + const char *type, void *data, + const struct thermal_cooling_device_ops *ops); + +struct thermal_cooling_device * +devm_thermal_of_cooling_device_register(struct device *dev, + struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops); #else =20 static inline @@ -211,6 +221,23 @@ static inline void devm_thermal_of_zone_unregister(str= uct device *dev, struct thermal_zone_device *tz) { } + +static inline struct thermal_cooling_device * +thermal_of_cooling_device_register(struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct thermal_cooling_device * +devm_thermal_of_cooling_device_register(struct device *dev, + struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + return ERR_PTR(-ENODEV); +} #endif =20 int for_each_thermal_trip(struct thermal_zone_device *tz, @@ -252,14 +279,6 @@ void thermal_zone_device_update(struct thermal_zone_de= vice *, =20 struct thermal_cooling_device *thermal_cooling_device_register(const char = *, void *, const struct thermal_cooling_device_ops *); -struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, const char *, v= oid *, - const struct thermal_cooling_device_ops *); -struct thermal_cooling_device * -devm_thermal_of_cooling_device_register(struct device *dev, - struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops); =20 struct thermal_cooling_device * devm_thermal_cooling_device_register(struct device *dev, const char *type, @@ -309,19 +328,6 @@ static inline struct thermal_cooling_device * thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } -static inline struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) -{ return ERR_PTR(-ENODEV); } -static inline struct thermal_cooling_device * -devm_thermal_of_cooling_device_register(struct device *dev, - struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) -{ - return ERR_PTR(-ENODEV); -} =20 struct thermal_cooling_device * devm_thermal_cooling_device_register(struct device *dev, const char *type, --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 009B72EC0A1 for ; Sun, 19 Apr 2026 18:22:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622971; cv=none; b=fAvRRDF1sD7vHr/2JSNOAEdm//ZmSRwxtImfoJdl1ILgj5lLyz9tA+cTO538nNXwl/LrGUJlYvd9LLMe2fbAVIN0vaim1bej/+zgIzsTt/GumeWZ8UZzBUM3+d4cNM5t8jX48i2A+NgfNBIFGoIZKRxzlmz49BJkAkW07f7xdVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622971; c=relaxed/simple; bh=+x9c9NXuRa5b02u2PWhWcGBzOOAZ9xf2sJMC+EoLd2M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NL1ut/1sYepk78FRk3dqtprBIn7+JZf5ReSjEufNT22tfZOsEhHKcGC6TI8ae/K3Vgp17+0tWFrnrN9z4ewIERwrb+Xlt7K5U15ZzN7CvO0x5j0OnETXsxogv+in51XPkcX6rROPZfIZpUOB8Rqh5CbUr+4Fn0pZS2u4LSL5Dr8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=JwD1Tyb+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=WbrSbzZh; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="JwD1Tyb+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="WbrSbzZh" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JFMrdL1410553 for ; Sun, 19 Apr 2026 18:22:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=lO8B9/Q2g6C ekw4Z+jMGvtIbLlF84pmBrYJu05mJ+9E=; b=JwD1Tyb+BwQ7FAk2LDV+ceBz1T9 TZOX0HAjW2onU8WkhUmGt1mGJ6JapPn0U+qkaJMqXst5n6cfnRe3wgdVhXztrTJM ZJZ/KVOlx+h9UYpRO9BRwpn7tdomK0bQkS3Gfj88x2WkPtSodImNo4/OLPM6YHG9 tfrRkya4KGJvZLl1qAsR+/HaK3j0+S1fnPJf9pqFdd32biMAVi3i3LIrYzSY5hN1 vKEEzJ8xiRLLSlUOHFyKGqf3vm1k2B1aCFp19eSPecAfMl/ATfGUVj4CZYq/uUqR uy6+13eYyRzTkOW+tE50BRAsuAP9ELSehUgogTzpwXad2CJC2fAWykONcdA== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm21ujysf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:49 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-50d5aa81907so49782431cf.0 for ; Sun, 19 Apr 2026 11:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622968; x=1777227768; darn=vger.kernel.org; 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=lO8B9/Q2g6Cekw4Z+jMGvtIbLlF84pmBrYJu05mJ+9E=; b=WbrSbzZhuIXppn3v7XzYXGzPgcJ9YcxQItTPI5RYqy6cAY2Ez6bkm9WyUAWnh9KyCJ uK99kNRWPMXLVD4gmDIUKG6K4YwwOaLKO5+1Ik2sCJ7TkkjDMVp+VArlFMgYqTsi64Vs zocUc3g57mgrHRQnZsaKHGLC3rzSYXoMLwiVxPPEOUrUo9z+983UeNDrLGKXOwzuxAQO H5Ev45xVhTnZR9LhflFKHNzHXdW3umiKx/r7s9AGAzoPs/Wr+A4e1Ydn10ujkEVUgTbS W/f643EY7bNuHsS8NcRctcsWt5JqoPRtIQCRWz6WS/Z0fVYcjvF30XBQBns8LDFv4mMb ddkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622968; x=1777227768; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lO8B9/Q2g6Cekw4Z+jMGvtIbLlF84pmBrYJu05mJ+9E=; b=qcHatBnNU8pEqkzthm54bX7mUJS1Gbl2pb7Ak8pCmGvgFMHYECMBS3uU8MaWuFOFIw 2NDGn+3IPvhJb0wHWNUY/JlUDlH3MCnoIp/KT5EgwUlR6WAuJTeteLQX728p7EywGjzH 9vmG4oSPtjvTd5pSbEMqoh0V5mWzT5b6jvqOXnuAHqcKedLiTQzJII1wU/RogjvMEjo+ QVBCWz9LoQFAFgktNvlRGtfaheBY1mrI395E3skfMLm0GXx4OzzL29L3by5cUEI8jROL 2LJXAE12SIii1/oA9GYz+iX8+OIK16erYcguH2Dc3HXMyI2sTzfosWqn24T4zoTzmlNg 7WnQ== X-Forwarded-Encrypted: i=1; AFNElJ8O/ALR+QR5xzuSNts4d7ThXzJXeZl9l987MHKuO1h0Fj/d1+9yTUH93XffSatzYixIyGGYPJO3Hc2pLb4=@vger.kernel.org X-Gm-Message-State: AOJu0YyYLqjZ+qHv1VE2M687C7mV9PdLXxeDir5IrZMtlefRiyvO6ZFw nYDrmEl/XQsoOegEhlJYov/MW7nQFoIO3oDIBusuwPWdW6xLN3aLMkloWlx0rswt+ItDEP/ibvo /YaGd/T/bt4VOnXyCfPOhzbAk3dJbOLp8beRqdzGMsmxO/Jo6GCPF13xfvPOGTfxCjF0= X-Gm-Gg: AeBDietI2FkASfUfdFr7G3PqdLf2juXawBW6lOabVyez8nIDLa6gbHFzO+cW6RsMsML e9Qaiw/zSZNNcZhQod2HlCQz3/b5DjHOxOxSodLU1SkUoYN+bsOeAmdU/z0Wr/zuw2Jph2pxTdc x7RNhkd5sDOSyJVU7qZniGdUfpw8Y0E+VnUnMgMdeanEOX5gIzYOmIDuoMkFsJfn4Li+fVOgmke Sv/qao+Dk5NHtm+tY3n/jVNws+Z31FZJ0ZCtduZHOqwQF0XUj5EvnHwqx6P9HEQvKY0E7wasHW3 XSJmEZzwjUF1xx86LS5BSFEaKzXXwFiEkE7eh5aG/hJKPOWO1KWOcw0ZP1gg/4yZOLGJh8u7NLo DTuqRXnEwXXRM+rzSEc8bIWqc1mB/9pkln0PjA9f72KNxub7rnkN4IdBx5mon X-Received: by 2002:a05:622a:4cc4:b0:50d:8389:c3f4 with SMTP id d75a77b69052e-50e36c78259mr168044051cf.55.1776622968490; Sun, 19 Apr 2026 11:22:48 -0700 (PDT) X-Received: by 2002:a05:622a:4cc4:b0:50d:8389:c3f4 with SMTP id d75a77b69052e-50e36c78259mr168043551cf.55.1776622968086; Sun, 19 Apr 2026 11:22:48 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:47 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 09/14] thermal/core: Put of_node field cooling device structure under Kconfig option Date: Sun, 19 Apr 2026 20:21:53 +0200 Message-ID: <20260419182203.4083985-10-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX89igVLz/sIZS yJ0hEb6f96Bn8DbVT9dCoT3HhZPU+gQI5dcLO4DolqdXjRl78ga5MuM6qUcG+38wdLZ8srMkyde T8AXg31Gy1Z5rQ5o0HgPuLbdYWfmD6/ED2g5fDLsfJj7uq/jpKMKHbay4G9WjE9ebsOVWhX2lGK iBC1CiEDNHy2egh7A2Ef8YHA0vMt3evaqTe6U5zMkcb03gNjbrrhTyxuIBjp5t2C4TTaJ+sq5Td UOE2kpKsW1yx6uc2WLqtUNTWiLzMGrWwbAR8w4dslsHRkfgk6KRAJLZPWtCh6c7ZscbhZW0pre+ 4VS9fTO3ewD40xlpU1WpCU6bZ++zWzu3QnmO+x7YHQdRLyG+RgAurUYr+ZueCOE1HY/tIfGLth1 hS01/Ul4/xr3Sum8XJ+8kpXBtsxDXG9ftZB7r53q5qkcxM7N4+ajKp636HJXOUlSLzklpFc4vcg lyoR+IgUtHHavlKrmlQ== X-Proofpoint-GUID: K0JLaDCJe9YIIsYWarDIa9nrX99na8BS X-Proofpoint-ORIG-GUID: K0JLaDCJe9YIIsYWarDIa9nrX99na8BS X-Authority-Analysis: v=2.4 cv=WK1PmHsR c=1 sm=1 tr=0 ts=69e51d79 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=5aU8Z_IAf-MFAndoPNkA:9 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" The device node pointer in the cooling device structure is only needed by the thermal OF in order to bind a thermal zone with a cooling device. Now only the OF based drivers are using the thermal OF functions and do not call the function with a NULL device_node parameter as before. We can put this field under the CONFIG_THERMAL_OF condition and make it go away if the device tree is not used. Signed-off-by: Daniel Lezcano --- include/linux/thermal.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/thermal.h b/include/linux/thermal.h index f7b8651c1ed0..a8e870ca2e27 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -125,7 +125,6 @@ struct thermal_cooling_device { const char *type; unsigned long max_state; struct device device; - struct device_node *np; void *devdata; void *stats; const struct thermal_cooling_device_ops *ops; @@ -133,6 +132,9 @@ struct thermal_cooling_device { struct mutex lock; /* protect thermal_instances list */ struct list_head thermal_instances; struct list_head node; +#ifdef CONFIG_THERMAL_OF + struct device_node *np; +#endif #ifdef CONFIG_THERMAL_DEBUGFS struct thermal_debugfs *debugfs; #endif --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D353C2E3B15 for ; Sun, 19 Apr 2026 18:22:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622977; cv=none; b=bMIJPEmVghpmBbw++EvHcseeJJlNuZRVpY3AAxgY0fepZvWRH4bjwOhyA9i3SjMBxSEfIcJPGM8hHAgmvsqxLIyznguOi9A7Re2FojIMqD+kfcm8yTslYon0uDplCtDFTJAeLFAskeXZ0plYXUeYohjVCYpii8RFPMLqgPwmZBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622977; c=relaxed/simple; bh=uvMe6b1zb38YS1AwKWlW1Wb69+UoV+y1Uhva8MHCVFM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XKKdmTnz+a7UdnZ9n4fQ3pu4zhfGrFpRVMbmDCIzcYuBiEFGPxHj3YHV6OojkmKF3d9YQXTo5R0rTp8iGw5afNBLiUkKKInOKN0PeUUcsqDNHbi39nwyXK8uv6EY5GEtVvG/Z/QVCWRBAKPHv2a00XqJYdql1ga3k4WAPHkrU34= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TXqzmNlL; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PYHFrKlR; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TXqzmNlL"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PYHFrKlR" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JBH53G915482 for ; Sun, 19 Apr 2026 18:22:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=wxDS+E6AjtQ 7nckN1UafhZkE9UqxJp4Wfu7o2Vgej8Q=; b=TXqzmNlLXDsR9aIx3b5BDLVYJ6g Cqc7dW4U//Xfbt4HvRlStD6bMHWTSVgePM9INkU/md330W6dK/s6hQc7vLrJolSs LJBHNl7s8tXl1nmR9VfVdKqkTwuRX8kWzPoSPRcCMnVQsambtJPfdZgqEQbrbKxk UDAlwAzKjREIld4e2RgZ8rtKj0wMbyEc6ClVuph/b5ykuzWqoHPPbqIo5pH+2K01 BSU/pHT7V5FiVgZQqk+r0tlQVCFi3phUDaEPMjlLVwQHAfZAb+G0mlNbr/57cci4 lWY0Aglyz1Iohoaa1NKYWPBDecugrazL/m3prF4DE5VN90CDY0WkU/BKPkA== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm21ujysr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:52 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-50b220c72bbso62770861cf.1 for ; Sun, 19 Apr 2026 11:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622972; x=1777227772; darn=vger.kernel.org; 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=wxDS+E6AjtQ7nckN1UafhZkE9UqxJp4Wfu7o2Vgej8Q=; b=PYHFrKlRQvc99jMLviXCOy6VtbnW9EBEZVdiJLbTZY6X8yl5/vK+ru2GeceltAXhPi TwcoAC0L2fYC7c5SIXpgXwccKL3F+JIuIhF8/dbB6y0PWmh00+7AmQmLda5Enw8+TZWI qDiXNWIXm8pAS0wVokutpdpS4t2i3+nQWpXPtOiwZ2zW/GoDOEVeoVaOqPNQp4NIMHic 6MYxGA8T5V9l+hZeIxKtiHMTGuUS/pusVGCDZJ5CxlCOm8Q3RpVNf3wrMcwtntfPq4KR cuiOMuSRQe8LNyUGBA+iZMeWBWRbbNhNRC3oCaI7caq1GPm+xNllx0q05/s4wftczUci 3dQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622972; x=1777227772; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wxDS+E6AjtQ7nckN1UafhZkE9UqxJp4Wfu7o2Vgej8Q=; b=RItWNDHoY9R5UDfOokTmNAcMQKB0xUJiFtdG3Ddy59/q83w+7pccFetO42YBD2GXus 5gmYLl/xje2nDwnDk8EHmfH7W3e82U4fAmqZNau5RScYHmlkJzoU7Lu9exhYsUc4Drvx d3zZgbwk+r/Ix1AyVAytqVm5I1wUqlDsnSYcZ6kkn/EFeVM1qtYH6b51cK1PNphWFW3J kk1kRJFlQwxs/wDX8u1As0d8JRlvZV7WS1o57CgzWxvy+77FlbkvSo9b9dic3oxdure9 a0gDBI8UQFcn+k/Pmqkk3DOVACywH5l25nu813PCgMbHrSzZ/emteCxTojkOIDKWWOa2 QCaw== X-Forwarded-Encrypted: i=1; AFNElJ8TnoTKuzq/28bLJ/xwMQY+dV3FFymGAsC54KKbl86tbuK3i5ZMSVcp2XbJ+nAppuGquavRd1AbEqmRZ4E=@vger.kernel.org X-Gm-Message-State: AOJu0YzdVWL50v+qMT8FjpFD1bH+thmOgK035ObCy1F1D5oDy+vL51P1 /oF8LzTMODn/Ys6L3/XF0TQ2pRn1vWA4/5bKOipClLp7rWaLtnSUsL0z89cfw/UevqBWsQratIy Xd0clSR/eFKy4UA5h9sNzzyraA8zxnyvkmxURKvQg23JZXWtZiseX0M4Cj60D4tRMbM4= X-Gm-Gg: AeBDiev3jBo6scLZFF/IHI92OcWgsq0ohh0ekbBx2Zrvw15DdB8CK3M+WEBcuAP3gPh gdi+ynd76Da2x2nU4NgNYiKC1LSylYV5thCzKcwUuLwE3YmlG6+m4BQaiQ5G+ZTBbckcNoLjFMj alJtXNku/FTcO1xoaNEANJeazbNKdA3L1w4BtHYTQ/UiJt2BARTv0XTBomqpZf43usCbIu/x1iu u4XdGiJHn7+7AuD0wGzxhds7N7ygX9/yDCuSM0DEC4L0l/RELyUFhPpUOKduCuQqA/PPfqpbxUG FkjcmAVrxFTR0NRZjOwoipvQvQCQQWwo8xeb7vEwvtyOVqZNyk9As6gDfP9N0OhR1CQAF/MjqVj 2tip246HjCNCfxtAeF5vMBKKBprzVtKrK3VWV3U2MtAPcgRF0Vm+FfZr4PH7U X-Received: by 2002:a05:622a:112:b0:4ee:1b0e:861a with SMTP id d75a77b69052e-50e36940b98mr155537381cf.13.1776622972132; Sun, 19 Apr 2026 11:22:52 -0700 (PDT) X-Received: by 2002:a05:622a:112:b0:4ee:1b0e:861a with SMTP id d75a77b69052e-50e36940b98mr155536611cf.13.1776622971624; Sun, 19 Apr 2026 11:22:51 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:50 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Krzysztof Kozlowski , Daniel Lezcano , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Thomas Gleixner , Ingo Molnar , "Jiri Slaby (SUSE)" , Mikko Perttunen , Svyatoslav Ryhel , linux-arm-kernel@lists.infradead.org (moderated list:ARM/ASPEED MACHINE SUPPORT), linux-aspeed@lists.ozlabs.org (moderated list:ARM/ASPEED MACHINE SUPPORT), openbmc@lists.ozlabs.org (moderated list:ARM/NUVOTON NPCM ARCHITECTURE), linux-tegra@vger.kernel.org (open list:TEGRA ARCHITECTURE SUPPORT), linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM MAILING LIST), linux-amlogic@lists.infradead.org (open list:KHADAS MCU MFD DRIVER), llvm@lists.linux.dev (open list:CLANG/LLVM BUILD SUPPORT) Subject: [PATCH v1 10/14] thermal/of: Rename the devm_thermal_of_cooling_device_register() function Date: Sun, 19 Apr 2026 20:21:54 +0200 Message-ID: <20260419182203.4083985-11-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX3GTyhVXzRh7e oVM3LrKZSznEXSU39zc2Ya4B8MgSpsqqMMRM/cz9vPjYFqlHPFh5PhawMr3yq7rptQFjNbOiqFJ 8J6HtrW12BN3E3SUI770UG08Im4rpnkNXraYio8FyIC54GTgREklSEukvptGUa3aQ2dbIiiIvgs 4CFEZl2jJVxu+fEdxGwhC/STf5+SrlRE5LxLDzh1oQOVEicwmnt85ZV40kuerKEOPLS6v/o2YhB Kh/qsVeqQjGACWNi/HQhFw5mqO2C+vad3JntZQpCjJs2ezXAf9YqZ7MQX/nrplzVDtE5SmK4GCG iFbxksbENFuk3Q3Z9eh4rfzs1lDYu4JGRUARG7waH+aOsN+69annKNRRo8pP6pHRXgNreHHq9jW E8xpXY01TOz7jviRfAY0BNMTVHxxcjSUJERhOIbHjmGDh9k1pm1I0ZmGsxrBiTtdhtMqvMJllLw h7p0y0qumRphXJDpjnw== X-Proofpoint-GUID: uKVPPBPZ3nKxk2XU2vjxHa84V9nb-FxH X-Proofpoint-ORIG-GUID: uKVPPBPZ3nKxk2XU2vjxHa84V9nb-FxH X-Authority-Analysis: v=2.4 cv=WK1PmHsR c=1 sm=1 tr=0 ts=69e51d7c cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=9QVJCMzFHTx7fD6CVgwA:9 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" The cooling devices can be composed with a cooling device controller and a set of cooling devices attached to it. Until now, the DT bindings were described using a node for the cooling device controller and child nodes for all the cooling devices. Recently, a new set of cooling devices were proposed with the same bindings. Those were rejected because DT maintainers do not want this format anymore. In place, a cooling device will be created with an id. Whatever its meaning, the thermal OF will bind a thermal zone and a cooling device by checking the device node pointer + the id are matching the cooling map with the cooling device. Actually this approach is consistent with the thermal which are also registered with a device and an id. In order to do a distinction between the old binding with child nodes and the incoming new binding, let's rename the registering function with a self-explanatory name. Rename the functions: devm_thermal_of_cooling_device_register() -> devm_thermal_of_child_cooling= _device_register() Used the command: find . -type f -name '*.[ch]' -exec \ sed -i 's/devm_thermal_of_cooling_device_register/\ devm_thermal_of_child_cooling_device_register/g' {} \; Did not used clang-format-diff because it does not indent correctly and checkpatch complained. Manually reindented to make checkpatch happy Signed-off-by: Daniel Lezcano --- drivers/hwmon/amc6821.c | 2 +- drivers/hwmon/aspeed-pwm-tacho.c | 5 +++-- drivers/hwmon/emc2305.c | 6 +++--- drivers/hwmon/gpio-fan.c | 6 ++++-- drivers/hwmon/max6650.c | 6 +++--- drivers/hwmon/npcm750-pwm-fan.c | 6 ++++-- drivers/hwmon/pwm-fan.c | 5 +++-- drivers/hwmon/qnap-mcu-hwmon.c | 6 +++--- drivers/hwmon/tc654.c | 5 +++-- drivers/memory/tegra/tegra210-emc-core.c | 4 ++-- drivers/soc/qcom/qcom_aoss.c | 2 +- drivers/thermal/khadas_mcu_fan.c | 7 ++++--- drivers/thermal/tegra/soctherm.c | 6 +++--- drivers/thermal/thermal_of.c | 12 ++++++------ include/linux/thermal.h | 16 ++++++++-------- 15 files changed, 51 insertions(+), 43 deletions(-) diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index d5f864b360b0..8e5926b06070 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c @@ -1076,7 +1076,7 @@ static int amc6821_probe(struct i2c_client *client) "Failed to initialize hwmon\n"); =20 if (IS_ENABLED(CONFIG_THERMAL) && fan_np && data->fan_cooling_levels) - return PTR_ERR_OR_ZERO(devm_thermal_of_cooling_device_register(dev, + return PTR_ERR_OR_ZERO(devm_thermal_of_child_cooling_device_register(dev, fan_np, client->name, data, &amc6821_cooling_ops)); =20 return 0; diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-ta= cho.c index aa159bf158a3..1c5945d4ba37 100644 --- a/drivers/hwmon/aspeed-pwm-tacho.c +++ b/drivers/hwmon/aspeed-pwm-tacho.c @@ -841,8 +841,9 @@ static int aspeed_create_pwm_cooling(struct device *dev, } snprintf(cdev->name, MAX_CDEV_NAME_LEN, "%pOFn%d", child, pwm_port); =20 - cdev->tcdev =3D devm_thermal_of_cooling_device_register(dev, child, - cdev->name, cdev, &aspeed_pwm_cool_ops); + cdev->tcdev =3D devm_thermal_of_child_cooling_device_register(dev, child, + cdev->name, cdev, + &aspeed_pwm_cool_ops); if (IS_ERR(cdev->tcdev)) return PTR_ERR(cdev->tcdev); =20 diff --git a/drivers/hwmon/emc2305.c b/drivers/hwmon/emc2305.c index 64b213e1451e..2505e9fac499 100644 --- a/drivers/hwmon/emc2305.c +++ b/drivers/hwmon/emc2305.c @@ -309,9 +309,9 @@ static int emc2305_set_single_tz(struct device *dev, st= ruct device_node *fan_nod pwm =3D data->pwm_min[cdev_idx]; =20 data->cdev_data[cdev_idx].cdev =3D - devm_thermal_of_cooling_device_register(dev, fan_node, - emc2305_fan_name[idx], data, - &emc2305_cooling_ops); + devm_thermal_of_child_cooling_device_register(dev, fan_node, + emc2305_fan_name[idx], data, + &emc2305_cooling_ops); =20 if (IS_ERR(data->cdev_data[cdev_idx].cdev)) { dev_err(dev, "Failed to register cooling device %s\n", emc2305_fan_name[= idx]); diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index a8892ced1e54..084828e1e281 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -592,8 +592,10 @@ static int gpio_fan_probe(struct platform_device *pdev) } =20 /* Optional cooling device register for Device tree platforms */ - fan_data->cdev =3D devm_thermal_of_cooling_device_register(dev, np, - "gpio-fan", fan_data, &gpio_fan_cool_ops); + fan_data->cdev =3D devm_thermal_of_child_cooling_device_register(dev, np, + "gpio-fan", + fan_data, + &gpio_fan_cool_ops); =20 dev_info(dev, "GPIO fan initialized\n"); =20 diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 9649c6611d5f..a50b1b0f1f48 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c @@ -793,9 +793,9 @@ static int max6650_probe(struct i2c_client *client) return err; =20 if (IS_ENABLED(CONFIG_THERMAL)) { - cooling_dev =3D devm_thermal_of_cooling_device_register(dev, - dev->of_node, client->name, - data, &max6650_cooling_ops); + cooling_dev =3D devm_thermal_of_child_cooling_device_register(dev, dev->= of_node, + client->name, data, + &max6650_cooling_ops); if (IS_ERR(cooling_dev)) { dev_warn(dev, "thermal cooling device register failed: %ld\n", PTR_ERR(cooling_dev)); diff --git a/drivers/hwmon/npcm750-pwm-fan.c b/drivers/hwmon/npcm750-pwm-fa= n.c index c8f5e695fb6d..aea0b8659f5f 100644 --- a/drivers/hwmon/npcm750-pwm-fan.c +++ b/drivers/hwmon/npcm750-pwm-fan.c @@ -857,8 +857,10 @@ static int npcm7xx_create_pwm_cooling(struct device *d= ev, snprintf(cdev->name, THERMAL_NAME_LENGTH, "%pOFn%d", child, pwm_port); =20 - cdev->tcdev =3D devm_thermal_of_cooling_device_register(dev, child, - cdev->name, cdev, &npcm7xx_pwm_cool_ops); + cdev->tcdev =3D devm_thermal_of_child_cooling_device_register(dev, child, + cdev->name, + cdev, + &npcm7xx_pwm_cool_ops); if (IS_ERR(cdev->tcdev)) return PTR_ERR(cdev->tcdev); =20 diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c index 37269db2de84..e6a567d58579 100644 --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -685,8 +685,9 @@ static int pwm_fan_probe(struct platform_device *pdev) =20 ctx->pwm_fan_state =3D ctx->pwm_fan_max_state; if (IS_ENABLED(CONFIG_THERMAL)) { - cdev =3D devm_thermal_of_cooling_device_register(dev, - dev->of_node, "pwm-fan", ctx, &pwm_fan_cooling_ops); + cdev =3D devm_thermal_of_child_cooling_device_register(dev, dev->of_node, + "pwm-fan", ctx, + &pwm_fan_cooling_ops); if (IS_ERR(cdev)) { ret =3D PTR_ERR(cdev); dev_err(dev, diff --git a/drivers/hwmon/qnap-mcu-hwmon.c b/drivers/hwmon/qnap-mcu-hwmon.c index e86e64c4d391..c1c1e9d6f340 100644 --- a/drivers/hwmon/qnap-mcu-hwmon.c +++ b/drivers/hwmon/qnap-mcu-hwmon.c @@ -337,9 +337,9 @@ static int qnap_mcu_hwmon_probe(struct platform_device = *pdev) * levels and only succeed with either no or correct cooling levels. */ if (IS_ENABLED(CONFIG_THERMAL) && hwm->fan_cooling_levels) { - cdev =3D devm_thermal_of_cooling_device_register(dev, - to_of_node(hwm->fan_node), "qnap-mcu-hwmon", - hwm, &qnap_mcu_hwmon_cooling_ops); + cdev =3D devm_thermal_of_child_cooling_device_register(dev, to_of_node(h= wm->fan_node), + "qnap-mcu-hwmon", hwm, + &qnap_mcu_hwmon_cooling_ops); if (IS_ERR(cdev)) return dev_err_probe(dev, PTR_ERR(cdev), "Failed to register qnap-mcu-hwmon as cooling device\n"); diff --git a/drivers/hwmon/tc654.c b/drivers/hwmon/tc654.c index 39fe5836f237..ba18b442b81e 100644 --- a/drivers/hwmon/tc654.c +++ b/drivers/hwmon/tc654.c @@ -541,8 +541,9 @@ static int tc654_probe(struct i2c_client *client) if (IS_ENABLED(CONFIG_THERMAL)) { struct thermal_cooling_device *cdev; =20 - cdev =3D devm_thermal_of_cooling_device_register(dev, dev->of_node, clie= nt->name, - hwmon_dev, &tc654_fan_cool_ops); + cdev =3D devm_thermal_of_child_cooling_device_register(dev, dev->of_node, + client->name, hwmon_dev, + &tc654_fan_cool_ops); return PTR_ERR_OR_ZERO(cdev); } =20 diff --git a/drivers/memory/tegra/tegra210-emc-core.c b/drivers/memory/tegr= a/tegra210-emc-core.c index e96ca4157d48..065ae8bc2830 100644 --- a/drivers/memory/tegra/tegra210-emc-core.c +++ b/drivers/memory/tegra/tegra210-emc-core.c @@ -1966,8 +1966,8 @@ static int tegra210_emc_probe(struct platform_device = *pdev) =20 tegra210_emc_debugfs_init(emc); =20 - cd =3D devm_thermal_of_cooling_device_register(emc->dev, np, "emc", emc, - &tegra210_emc_cd_ops); + cd =3D devm_thermal_of_child_cooling_device_register(emc->dev, np, "emc",= emc, + &tegra210_emc_cd_ops); if (IS_ERR(cd)) { err =3D PTR_ERR(cd); dev_err(emc->dev, "failed to register cooling device: %d\n", diff --git a/drivers/soc/qcom/qcom_aoss.c b/drivers/soc/qcom/qcom_aoss.c index a543ab9bee6c..742f571200fa 100644 --- a/drivers/soc/qcom/qcom_aoss.c +++ b/drivers/soc/qcom/qcom_aoss.c @@ -381,7 +381,7 @@ static int qmp_cooling_device_add(struct qmp *qmp, qmp_cdev->qmp =3D qmp; qmp_cdev->state =3D !qmp_cdev_max_state; qmp_cdev->name =3D cdev_name; - qmp_cdev->cdev =3D devm_thermal_of_cooling_device_register + qmp_cdev->cdev =3D devm_thermal_of_child_cooling_device_register (qmp->dev, node, cdev_name, qmp_cdev, &qmp_cooling_device_ops); diff --git a/drivers/thermal/khadas_mcu_fan.c b/drivers/thermal/khadas_mcu_= fan.c index d35e5313bea4..21b3d0a71bd0 100644 --- a/drivers/thermal/khadas_mcu_fan.c +++ b/drivers/thermal/khadas_mcu_fan.c @@ -90,9 +90,10 @@ static int khadas_mcu_fan_probe(struct platform_device *= pdev) ctx->mcu =3D mcu; platform_set_drvdata(pdev, ctx); =20 - cdev =3D devm_thermal_of_cooling_device_register(dev->parent, - dev->parent->of_node, "khadas-mcu-fan", ctx, - &khadas_mcu_fan_cooling_ops); + cdev =3D devm_thermal_of_child_cooling_device_register(dev->parent, + dev->parent->of_node, + "khadas-mcu-fan", ctx, + &khadas_mcu_fan_cooling_ops); if (IS_ERR(cdev)) { ret =3D PTR_ERR(cdev); dev_err(dev, "Failed to register khadas-mcu-fan as cooling device: %d\n", diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/socth= erm.c index 9d3eb3be2db0..9911f3ec0f40 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -1700,9 +1700,9 @@ static void soctherm_init_hw_throt_cdev(struct platfo= rm_device *pdev) stc->init =3D true; } else { =20 - tcd =3D devm_thermal_of_cooling_device_register(dev, np_stcc, - (char *)name, ts, - &throt_cooling_ops); + tcd =3D devm_thermal_of_child_cooling_device_register(dev, np_stcc, + (char *)name, ts, + &throt_cooling_ops); if (IS_ERR_OR_NULL(tcd)) { dev_err(dev, "throttle-cfg: %s: failed to register cooling device\n", diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 3d2fb8f37b9c..ba5093f612d0 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -550,7 +550,7 @@ static void thermal_cooling_device_release(struct devic= e *dev, void *res) } =20 /** - * devm_thermal_of_cooling_device_register() - register an OF thermal cool= ing + * devm_thermal_of_child_cooling_device_register() - register an OF therma= l cooling * device * @dev: a valid struct device pointer of a sensor device. * @np: a pointer to a device tree node. @@ -567,10 +567,10 @@ static void thermal_cooling_device_release(struct dev= ice *dev, void *res) * ERR_PTR. Caller must check return value with IS_ERR*() helpers. */ struct thermal_cooling_device * -devm_thermal_of_cooling_device_register(struct device *dev, - struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) +devm_thermal_of_child_cooling_device_register(struct device *dev, + struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) { struct thermal_cooling_device **ptr, *tcd; =20 @@ -590,4 +590,4 @@ devm_thermal_of_cooling_device_register(struct device *= dev, =20 return tcd; } -EXPORT_SYMBOL_GPL(devm_thermal_of_cooling_device_register); +EXPORT_SYMBOL_GPL(devm_thermal_of_child_cooling_device_register); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index a8e870ca2e27..6535353ae83c 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -206,10 +206,10 @@ thermal_of_cooling_device_register(struct device_node= *np, const struct thermal_cooling_device_ops *ops); =20 struct thermal_cooling_device * -devm_thermal_of_cooling_device_register(struct device *dev, - struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops); +devm_thermal_of_child_cooling_device_register(struct device *dev, + struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops); #else =20 static inline @@ -233,10 +233,10 @@ thermal_of_cooling_device_register(struct device_node= *np, } =20 static inline struct thermal_cooling_device * -devm_thermal_of_cooling_device_register(struct device *dev, - struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) +devm_thermal_of_child_cooling_device_register(struct device *dev, + struct device_node *np, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) { return ERR_PTR(-ENODEV); } --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D5842ED843 for ; Sun, 19 Apr 2026 18:22:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622978; cv=none; b=jFGInOm/IhA923Uek+DFviGe7p+7iKmvxPpRjkkqE7OuBZkObbBRBcyl4wdkqhDpHl74nnMD36FQ7ns7sbEaFpBblWCGKknyyBC2zNhQawPWQhHA3a5dzitXc0nni+Fc9965n9bfWvoTGeOFp1qRuWw7TQbdqAqJ4R964T+96Bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622978; c=relaxed/simple; bh=povEAdOX2hGXcdSaXed4zJHRaXYtqJTTyhdfcFG83BI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JxE5HHz1Bk7G+fmDtV9GvbwTLqVrWz70sDSk3KdnejiQiuz7oXQVL8TH51xyZlV7IZ0W36waDRKq+H5YbaYQnAZrSKpqGuD55KIo730zwS2nmZ9CHdso0i4AgH3GR96DdSNkvvV3t0rWWq782XwAy3m0sSoN41vZuI/Ewdj0Di4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TtI/BbYq; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Eql5bx7j; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TtI/BbYq"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Eql5bx7j" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JBqaOR3241991 for ; Sun, 19 Apr 2026 18:22:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=mBAk+Sm+mnO 5DTzI9lKqPEUkJ5P/e03TPLtapt4NgHw=; b=TtI/BbYqpUab5NfqgQhMFLclp+1 vB8QQKaUZdB3IKVwvUETKTX7BPZaM0leoiaXakCLo+BH3SBzBCFmCiehpHxoXYZM pM+ImQCuUPJdNay9rYSFyPJMflKv5KATqG+qDw2CnQof6stTseqGtop+jqw3YtnZ 2gi3MuZITOPyCcC6+OKw8mhoS4FlFGH01J9J1DJWArEuDb1xPztJyEWE3Q4x2X0r uopJsMioEiWd4ImnyLchni5JQEAxGVeXYiVpiEMMAhVIKdWvyR+OscjBxdOoR6Yn CBQVZ3tVV3rJ20/nTm6ZzQzaW2GNfuEN9zMxaA5rJKuFOGUAEkWSM1c3rtA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm261u119-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:55 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb706313beso272077785a.3 for ; Sun, 19 Apr 2026 11:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622975; x=1777227775; darn=vger.kernel.org; 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=mBAk+Sm+mnO5DTzI9lKqPEUkJ5P/e03TPLtapt4NgHw=; b=Eql5bx7ji7v6RkxiDr9jn/dgXaqxyBXiFNl708/q108tqFTOgizdp2ZpkJ2UQpdqpL MR000OGUdo13lL5+YNs1xAjGdSZQ0IewxuzjRrjm5UgyiGnnu4m1ocOj6iK6RL0PSnue CqR6OIhKOvMZwrheP7vG+DMIARcFHaquz3A0BUBGX7qbThOqlIcFT2AHI+8eveH749zi k+X6E6AYShbhku0Dj5tcJAPHbMpTVAUEgvYoP4y6LTZ5xCH0H3aDyrVMo16F7u9ZD8Mz JthSnE7L/dL3LBNjv58hpPSJjzdO3lBC+UUopZ4PjcoNRLVnrqve75YgEPBQcxVruOg7 5Pmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622975; x=1777227775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mBAk+Sm+mnO5DTzI9lKqPEUkJ5P/e03TPLtapt4NgHw=; b=sQLJ7H1F1srpmDuO1CfyrnJUzKLw6v6TQU01iXDYxdFgh+7+4gc88pe0T2mJPwKAk1 bLugLBOYCEb8pPfJCZYSEDL49u9uDSTNSj56HjIdUCYP6Y9Bg6wp28GI9Oc5xaHvwv3f ygPYIK/W9ATHINqt9ACuMWDWjtGFmzAxLjtzHS+UaxCwqNAVY9GzVUU4FtJxG6Uo8zUt PeGfyOm+gUWaBtOGJb36suA3hH6L0O5wfbO1TQ99XUAeLfaPbLoAOTy/ELJaMU88EqDq XRTx1JVzgzJnWwTplEmLxP5HmcWFpaZxkqEtLItIyItSHDvmmAA+AcMnlH25rKboETVa bBNw== X-Forwarded-Encrypted: i=1; AFNElJ+4AMsxVuXmSVfCl+uANKcSIv2OXxZPBbow3Xb779u0OZRuKQcL4ItrQdes+Pm1K917itDVL+PWBtUB9gQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxPY0X3bxqTpkrZkNAWQzmBNZ6kgvF5tM5k3BIVLJJPmfrC5T+E PqMcxd811UbWQqSAbBxnBZTT53hmT+iF7YpoZaquBurXITCy7cUAj2lKZ+Ddv/3B4KmU0xYzTug M5CuCaJW9VBfiQAme9kB6rIB1OSAKFEF3ooyXNYGoYdhj6o7TOfhI3aAHwd0QDhy2Aos= X-Gm-Gg: AeBDieu5k2wzLYBgwctopJhY1Q1DefJM+uL+e5afdZHC9DfzuSvOafvdsjpgMNwzxNy UxNv3mKYeWFakDqwyA/JAP90woLnM+tBFvoArqmdXxeZ4jI9cypgb3eiV1GNVteq2bqSPRAikkG djUijTw9i5bdJ6D+bAssPo3/TuPP/6XsZVxgvqBZpqcLHFxL7hYXoLoA7pFTsBSy/f+Vz0s1GZM +UI7nsr3phuzv0JNGAfNqv7Woxhd/ltaIfFKGS/tV1VRsCI9x3+4htS7YT4x0Tfp1W9UlJC/FDf 4kfyypav/kYyU4pDXwupsjwUzcPDWpCPMUezGTjkB18V+mvwH0gfLuyRwRKwcsl3Ar9M/gqJsEd YZ2xcg2vsIcoxNGniArMB16LcI2RJaUEGRdOHpy41BJDbuB/T2Vh3dSnCUhTx X-Received: by 2002:a05:622a:5c05:b0:50b:4755:94b9 with SMTP id d75a77b69052e-50e36c77202mr167950451cf.56.1776622974630; Sun, 19 Apr 2026 11:22:54 -0700 (PDT) X-Received: by 2002:a05:622a:5c05:b0:50b:4755:94b9 with SMTP id d75a77b69052e-50e36c77202mr167950031cf.56.1776622974124; Sun, 19 Apr 2026 11:22:54 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:52 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano , etnaviv@lists.freedesktop.org (moderated list:DRM DRIVERS FOR VIVANTE GPU IP), dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR VIVANTE GPU IP) Subject: [PATCH v1 11/14] thermal/of: Introduce cooling device of_index Date: Sun, 19 Apr 2026 20:21:55 +0200 Message-ID: <20260419182203.4083985-12-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX1Aqx9s8R7i0W O30Qs+HD5DxBwlBlZrv7wO5CZEAzNyHRneEWViOX3WLMDziXzbNT8PggbHUB6pKpdhBDTINQvjc 2iYanEM+Mh1Shl24zFXOExsxj3ZHpNXcdr+2uoPXjk4eg0uUXqD5BWAe6DckjrHnncbG7LwzTNa NRS9rWSEQUc2b8F5JeUkzULQqJja0Sl/BxkP1BHoELWjJlQUjaldgJWE2pBsC9dOQtZmlhLKW03 tOWooFEM8CSdf/bN7Xl4NXeMtWVYPE3Bu0FMmnVxhqnE/5edhsw/5/0bCy3ef6rHwmXVS6XQWGU 4Usnst4eXiW1a9E2kIYacSxfN4D1abh1ckuBtloFLWIin31P/D4snYcI2jw6pTkL1gIHqQBd8iv gUV2l4tg/UePNQyY62AScKnlpTF9aqRymRmZjYK06P4bnCAlHKVNCeOTtZhiMt0vhFwvIufdh8M FMdS3kIYh7jKNVhlO1w== X-Authority-Analysis: v=2.4 cv=dcywG3Xe c=1 sm=1 tr=0 ts=69e51d7f cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=UUaV7nkyxFtcjw1PROYA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-ORIG-GUID: K0nnoPUXqUzfQPb9y0TWaC-2wcI2EYs9 X-Proofpoint-GUID: K0nnoPUXqUzfQPb9y0TWaC-2wcI2EYs9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 phishscore=0 malwarescore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" As described in the previous change, the new incoming DT binding will describe a tuple device_node + cooling device id, instead of child nodes. Let's augment thermal_of_cooling_device_register() to receive the cooling device id and propagate the changes to the four remaining drivers using the non-devm version of the cooling device registering function. Add the id in the cooling device structure and store the value when registering it. Signed-off-by: Daniel Lezcano --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 2 +- drivers/thermal/cpufreq_cooling.c | 2 +- drivers/thermal/cpuidle_cooling.c | 2 +- drivers/thermal/devfreq_cooling.c | 2 +- drivers/thermal/thermal_of.c | 6 ++++-- include/linux/thermal.h | 5 +++-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnavi= v/etnaviv_gpu.c index a891d4f1f843..a965cc0633fc 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1791,7 +1791,7 @@ static int etnaviv_gpu_bind(struct device *dev, struc= t device *master, int ret; =20 if (IS_ENABLED(CONFIG_DRM_ETNAVIV_THERMAL)) { - gpu->cooling =3D thermal_of_cooling_device_register(dev->of_node, + gpu->cooling =3D thermal_of_cooling_device_register(dev->of_node, 0, (char *)dev_name(dev), gpu, &cooling_ops); if (IS_ERR(gpu->cooling)) return PTR_ERR(gpu->cooling); diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_co= oling.c index 32bf5ab44f4a..768859a7aed0 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -592,7 +592,7 @@ __cpufreq_cooling_register(struct device_node *np, if (!name) goto remove_qos_req; =20 - cdev =3D thermal_of_cooling_device_register(np, name, cpufreq_cdev, + cdev =3D thermal_of_cooling_device_register(np, 0, name, cpufreq_cdev, cooling_ops); kfree(name); =20 diff --git a/drivers/thermal/cpuidle_cooling.c b/drivers/thermal/cpuidle_co= oling.c index 425f596614e8..bbd2e91cf5ab 100644 --- a/drivers/thermal/cpuidle_cooling.c +++ b/drivers/thermal/cpuidle_cooling.c @@ -207,7 +207,7 @@ static int __cpuidle_cooling_register(struct device_nod= e *np, goto out_unregister; } =20 - cdev =3D thermal_of_cooling_device_register(np, name, idle_cdev, + cdev =3D thermal_of_cooling_device_register(np, 0, name, idle_cdev, &cpuidle_cooling_ops); if (IS_ERR(cdev)) { ret =3D PTR_ERR(cdev); diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_co= oling.c index 1c7dffc8d45f..0330a8112832 100644 --- a/drivers/thermal/devfreq_cooling.c +++ b/drivers/thermal/devfreq_cooling.c @@ -454,7 +454,7 @@ of_devfreq_cooling_register_power(struct device_node *n= p, struct devfreq *df, if (!name) goto remove_qos_req; =20 - cdev =3D thermal_of_cooling_device_register(np, name, dfc, ops); + cdev =3D thermal_of_cooling_device_register(np, 0, name, dfc, ops); kfree(name); =20 if (IS_ERR(cdev)) { diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index ba5093f612d0..a728da1f4e56 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -514,6 +514,7 @@ EXPORT_SYMBOL_GPL(devm_thermal_of_zone_unregister); /** * thermal_of_cooling_device_register() - register an OF thermal cooling d= evice * @np: a pointer to a device tree node. + * @of_index: a cooling device index in the cooling controller * @type: the thermal cooling device type. * @devdata: device private data. * @ops: standard thermal cooling devices callbacks. @@ -527,7 +528,7 @@ EXPORT_SYMBOL_GPL(devm_thermal_of_zone_unregister); * ERR_PTR. Caller must check return value with IS_ERR*() helpers. */ struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, +thermal_of_cooling_device_register(struct device_node *np, int of_index, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { @@ -538,6 +539,7 @@ thermal_of_cooling_device_register(struct device_node *= np, return cdev; =20 cdev->np =3D np; + cdev->of_index =3D of_index; thermal_cooling_device_init_complete(cdev); =20 return cdev; @@ -579,7 +581,7 @@ devm_thermal_of_child_cooling_device_register(struct de= vice *dev, if (!ptr) return ERR_PTR(-ENOMEM); =20 - tcd =3D thermal_of_cooling_device_register(np, type, devdata, ops); + tcd =3D thermal_of_cooling_device_register(np, 0, type, devdata, ops); if (IS_ERR(tcd)) { devres_free(ptr); return tcd; diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 6535353ae83c..9813f02db088 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -134,6 +134,7 @@ struct thermal_cooling_device { struct list_head node; #ifdef CONFIG_THERMAL_OF struct device_node *np; + int of_index; #endif #ifdef CONFIG_THERMAL_DEBUGFS struct thermal_debugfs *debugfs; @@ -201,7 +202,7 @@ struct thermal_zone_device *devm_thermal_of_zone_regist= er(struct device *dev, in void devm_thermal_of_zone_unregister(struct device *dev, struct thermal_zo= ne_device *tz); =20 struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, +thermal_of_cooling_device_register(struct device_node *np, int of_index, const char *type, void *data, const struct thermal_cooling_device_ops *ops); =20 @@ -225,7 +226,7 @@ static inline void devm_thermal_of_zone_unregister(stru= ct device *dev, } =20 static inline struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, +thermal_of_cooling_device_register(struct device_node *np, int of_index, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EF2B2EB5CD for ; Sun, 19 Apr 2026 18:22:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622979; cv=none; b=t/QF7rZRG//zCRFnsmU/RmWgLhcStYI6rAjM9qT2pV7a6aD135x+o1oIh/ObFnqGHGNPvJsKzsOaAh89lzm4mtBBlRV9sBLTSZs91cxePUt5pCaVuhzqP1SWxo6PMAsjeOJUao7/y5dLJCq+4IOvIgCbH9KoZ/iRgct08JxxhYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622979; c=relaxed/simple; bh=qIr2LSO6D+VRNnsB+j6abzVrqDrxn26emwJAxmPi+dk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z1s1gBw2Bn+82t8zK/1Lu5zIN1gZ2YcTr3spjJG6n9iQn5QcH/6bD0qP0ADnv92rFobKqGqK3bmi+R0NsfY5nga437Bxavoi73LTtkE1Y1n86ieFS4RihBI2VO7o4Kwfwaiy42+rnK2Pfyvwce3f+2H0zWIP+cbtC+r11Qjl1j8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UN0OqZdZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GK12zBbq; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UN0OqZdZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GK12zBbq" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JGCdb6124821 for ; Sun, 19 Apr 2026 18:22:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=lXWSi0Khw8K Na6a8CumjpgrQ3+rYxh7RbfMTB8P3ox0=; b=UN0OqZdZPzhM3bB+CXDRgAs+f0y OytcYSBqZXuPFbDyJfIHWR5qyEAYVVtDlIgI2tsV9cDK9HgAPpBaxbViwspLetUi qM8YxxWtOBnZCMUROzJ9b52XbZNJcToHQiNucQv5Gn0RZmP6+Ohn6+aijGJjNbB9 aNA5ICJBVJ7sIv+VxMZo7cEQVpPBRscEAsqjR23ciW1u9eLxy88IiaFnQw/gJKCW w2iCCmbe/ciaytF57qiIMNUz0L8wYXHscw4QDvzAcvNdp/dS/lc4Tn4fBnjjjnj7 mcWd17EYK0xPtVn2fIsLncxDulfbyboLoyDROZgDvOL+BZMJo+/knnNIPrA== Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm1hx31x0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:57 +0000 (GMT) Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-50d8dac6233so38692061cf.2 for ; Sun, 19 Apr 2026 11:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622976; x=1777227776; darn=vger.kernel.org; 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=lXWSi0Khw8KNa6a8CumjpgrQ3+rYxh7RbfMTB8P3ox0=; b=GK12zBbqMG0gzu4S503QvJxt7BRYmvD+jINYzYE1nkjcABlj8o8VDJ/wGppXwea6I/ nQ3mJJg1Nfl1ezfE53PNrLCVTns96Ox5wf41K74Lekah0Ana20sYkcudcFdnJ/bXBIh2 5MnATebE/N2TUlNDTzxFLsljLomuPpEU7Xm64rJf6k4S220K8Rw0TF2FnaIPaz2VAYyL Wn9K1uLzg8nK5D4fauY7x2TgT4O6hVv2Pd/+XTfyBsSJbr9fhyQoTB/6wa6UEpjfA/K6 VTrOJk9nqS1Lb8hUfs7KbFAYXSP2hCdYP8RhQ4NvNnNq4I9g9si7rgummdSTlaHVyRgC POAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622976; x=1777227776; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lXWSi0Khw8KNa6a8CumjpgrQ3+rYxh7RbfMTB8P3ox0=; b=krznUfAELATwdXzTaiAFJfOhUu9OSZFdvEV0YuPNwAqdIozuOj77JCEL7ax57qi9mF ptXHSpqt+UEromuqAN7D2bQqa9+U2rRUs9viIp8WBVddTcXuV3cQ7Cua0w4DjSmzRXKN 3fgVM+hSehRxBC64xUBIEv/Sod8+JSJMWC7qL4qlavNhWiIjKVntwFHkyEQsXCnHm8rU 3pNkxn8aGf+KrnG+HjQuk7DOxnzXmdYhe1zZUjP/VYx32WqT4Vg7Zg1RaTy/TDTU6T49 4jhSNhHkH8Izah4J1oDUC5r4qMvlqn/jDdja/Wd/vgw5KQ5+f8pKrBxzdaSqMpKX7c2c i5tw== X-Forwarded-Encrypted: i=1; AFNElJ+OxTgCsrda199BwtKUMuwmh9QjFnO/ofM4ApdGjtKwq/Bs1z9u2OXM0QcARMd0HleAoXAv62OoSn0PwDQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzqWJbhai2yT5TVzKknvOHiqwm0UE1EqfAwkHYmSkYJiwz0bC3b NNdSYE6DAkAYqX/r8XGSmBaolhoCNtMXU/5jr62TJjb8kPUqx31LTtm2Dc8+yztkUdi49d0Jhjb x3ik+LmQssNQtrmpBh2nUHNuPjxPQqkW2n8IZGyIM7oOU/7gAi34A7sSTdQPzipOT4t8= X-Gm-Gg: AeBDievZGzej85gX/mFCc8FcGVxH68H7+SDC2I2/9SatBBukPnEMrnhjqSvEqk2yt7F hHz+owHD7gpy/tRNygs/UYa4D0Rrx3ksVMk4X6f0+fHTd60qXtw6idjstnd23vQnl8tZG2o8XPr 5a2u2HIRzAzhpgvSIUpJfpgBfjs6PmDvn5g45k67e/KsHkPwXJV9/ertboVkstEzk9K9W5SRzKG mjtGPD6ngetPBMGq5YIQgdSGggVyNmGkI620e+un/yKmQxUHoXgjLW9GY2MsHoxsndxWKj4bt0k 5ohJOUs3SknjtL+/R6OYzgsciYEkYQy3RcJ/tJfDEQYKec68qw6/R1guENRkk9AlWV8Sb5JNGz0 y/EvXc+Di5ok1H9D3BRxprSGctmAs6WHzDRIGZKLHTite6FZL6tVyrvHJGhvK X-Received: by 2002:a05:622a:1e07:b0:50d:9d8a:ebe9 with SMTP id d75a77b69052e-50e36bb058amr164434241cf.27.1776622976593; Sun, 19 Apr 2026 11:22:56 -0700 (PDT) X-Received: by 2002:a05:622a:1e07:b0:50d:9d8a:ebe9 with SMTP id d75a77b69052e-50e36bb058amr164433861cf.27.1776622976136; Sun, 19 Apr 2026 11:22:56 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:55 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 12/14] thermal/of: Pass the of_index and add a function to register with an index Date: Sun, 19 Apr 2026 20:21:56 +0200 Message-ID: <20260419182203.4083985-13-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: _z3Th_OcAKXBe4Wmu-Y-KWWXgHmm4MFL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX2egdq9FmIjH8 orNDLNTO11FYZR+Zhoqs0GW4CNTpX6H9TLc7YyXDDtbtLgKO69CWZ9ULHmjjHyE60NDE2/gZLcM Hf8TYvg6INxNTBrcrA36uCBxo6HABAz08sOb2kb+4HI/FNwLQ/mlwUGpMMte7Ksuk1pV/90KGTv wa/Fku+9h4+3EPOunxHw/LuyY9wjmyw3lUsnQj9KdP+XYWf4uxh0S5u+BJXaodPRfV3aJPRkEmH MgQeFH66eLZh6KNMaG81QpyH5hpFzLXGSqRUjB9n7CoqxLtqiR1bcSHdVfke9vBZFAloWCsMrC6 UdL5u3gEi3kGU2hy2RJgeZAp5vC70GrOCbYoX/A2orfWPMG454m4z2eGZ4Rr6oRtQG+YASnqnNT IQIkbgz/x5Csgsg2u/sSZPhaXbTa7bTDSap3A2F/ziX6iYLGCM3ZFp66eo/xNSTaHlPCC3VYcP+ bQiGFMojbRm03PNe+zQ== X-Proofpoint-GUID: _z3Th_OcAKXBe4Wmu-Y-KWWXgHmm4MFL X-Authority-Analysis: v=2.4 cv=RoX16imK c=1 sm=1 tr=0 ts=69e51d81 cx=c_pps a=JbAStetqSzwMeJznSMzCyw==:117 a=V4iKOSeYOELjiAWC:21 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=KHKEB8RYcew9Qe18FDUA:9 a=uxP6HrT_eTzRwkO_Te1X:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" Introduce a new function devm_thermal_of_cooling_device_register() which will register a cooling device and its id. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_of.c | 68 +++++++++++++++++++++++++++--------- include/linux/thermal.h | 13 +++++++ 2 files changed, 64 insertions(+), 17 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index a728da1f4e56..d9bd7dc01e19 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -551,6 +551,56 @@ static void thermal_cooling_device_release(struct devi= ce *dev, void *res) thermal_cooling_device_unregister(*(struct thermal_cooling_device **)res); } =20 +static struct thermal_cooling_device * +__devm_thermal_of_cooling_device_register(struct device *dev, struct devic= e_node *np, + int of_index, const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + struct thermal_cooling_device **ptr, *tcd; + + ptr =3D devres_alloc(thermal_cooling_device_release, sizeof(*ptr), + GFP_KERNEL); + if (!ptr) + return ERR_PTR(-ENOMEM); + + tcd =3D thermal_of_cooling_device_register(np, of_index, type, devdata, o= ps); + if (IS_ERR(tcd)) { + devres_free(ptr); + return tcd; + } + + *ptr =3D tcd; + devres_add(dev, ptr); + + return tcd; +} + +/** + * devm_thermal_of_cooling_device_register() - register an OF thermal cool= ing device + * @dev: a valid struct device pointer of a sensor device. + * @of_index: a cooling device index in the cooling controller + * @type: the thermal cooling device type. + * @devdata: device private data. + * @ops: standard thermal cooling devices callbacks. + * + * This function will register a cooling device with device tree node refe= rence. + * This interface function adds a new thermal cooling device (fan/processo= r/...) + * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind = itself + * to all the thermal zone devices registered at the same time. + * + * Return: a pointer to the created struct thermal_cooling_device or an + * ERR_PTR. Caller must check return value with IS_ERR*() helpers. + */ +struct thermal_cooling_device * +devm_thermal_of_cooling_device_register(struct device *dev, int of_index, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + return __devm_thermal_of_cooling_device_register(dev, dev->of_node, of_in= dex, + type, devdata, ops); +} +EXPORT_SYMBOL_GPL(devm_thermal_of_cooling_device_register); + /** * devm_thermal_of_child_cooling_device_register() - register an OF therma= l cooling * device @@ -574,22 +624,6 @@ devm_thermal_of_child_cooling_device_register(struct d= evice *dev, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - struct thermal_cooling_device **ptr, *tcd; - - ptr =3D devres_alloc(thermal_cooling_device_release, sizeof(*ptr), - GFP_KERNEL); - if (!ptr) - return ERR_PTR(-ENOMEM); - - tcd =3D thermal_of_cooling_device_register(np, 0, type, devdata, ops); - if (IS_ERR(tcd)) { - devres_free(ptr); - return tcd; - } - - *ptr =3D tcd; - devres_add(dev, ptr); - - return tcd; + return __devm_thermal_of_cooling_device_register(dev, np, 0, type, devdat= a, ops); } EXPORT_SYMBOL_GPL(devm_thermal_of_child_cooling_device_register); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 9813f02db088..b7e5496f3e78 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -206,6 +206,11 @@ thermal_of_cooling_device_register(struct device_node = *np, int of_index, const char *type, void *data, const struct thermal_cooling_device_ops *ops); =20 +struct thermal_cooling_device * +devm_thermal_of_cooling_device_register(struct device *dev, int of_index, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops); + struct thermal_cooling_device * devm_thermal_of_child_cooling_device_register(struct device *dev, struct device_node *np, @@ -233,6 +238,14 @@ thermal_of_cooling_device_register(struct device_node = *np, int of_index, return ERR_PTR(-ENODEV); } =20 +static inline struct thermal_cooling_device * +devm_thermal_of_cooling_device_register(struct device *dev, int of_index, + const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops) +{ + return ERR_PTR(-ENODEV); +} + static inline struct thermal_cooling_device * devm_thermal_of_child_cooling_device_register(struct device *dev, struct device_node *np, --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 982542EFDA4 for ; Sun, 19 Apr 2026 18:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622982; cv=none; b=UECY25YATMHoUNUDtQij+sAcUmBd0KS4db1z6HDnt+VQzfJULfKGGXRRh5+ZhBk96SziJ0l0RcZFRpY3PgzFGxzogKha4wH4N7YGoMMa8U1RuYrjwN1+63TVTr3gmdsObOpgOzVL7HDKqNFvvjoMKE8xetF47DkC6+79UEz+Aro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622982; c=relaxed/simple; bh=6SNqA+4nv4xjK696sb7FWsbUSU8CWbNmGGK/ldEvX/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hgNQesnJZ9Nkj04lpalJwfGehUS7LraT5QNlHShqZKAZVpkfTWAdj0JhEzCGfYEFzZG+dzsiGyHYLXxJK2OOTFmzhfntnOIv+YSi5FEWYCzGqxJI6AxXeeDPpgLpPOPjwcF0o1vIJrSEWLsiSd2djezb0N64bERo0LOFkvGWUk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lPMUfnKy; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AJw0LU4D; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="lPMUfnKy"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AJw0LU4D" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63IKfuGq1291838 for ; Sun, 19 Apr 2026 18:22:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=ZF7ss7dJWTH LLa9FNsnYJO3c6WZwqwMms+ionVBB/Og=; b=lPMUfnKyI4Rmj7JW2Kfyzqa0RoR aR4llScmm5hr4aGW8Mi9risNnK/doXnZ3P4gprZ7Rx9GWfjwaF77oNiSO9Fu3xYh wKkf2O1Qv61mbWgN2Ve15zIoFbf8GirZS8R28YESGRguoPYD67jeypknJhhAlIT4 q4OCXlBTNzP97pejWBC7DzbBbbxonDDNP8uymKyiHyewruuDvc6ipku/DMZrLhBi +/eEdP8S9D7s5UpUk4lT3bNmLlpCaKlbY/GR6F2RTISI4mFur6kycIeKv1qFRhRR WXEcqjUEknRLeWhgKqQyhlhnHvdgbbi020+Wu66AxWuSfBy4gTILh7DCsvg== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dkyank9dr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:59 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-50b4076dc16so22371391cf.2 for ; Sun, 19 Apr 2026 11:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622978; x=1777227778; darn=vger.kernel.org; 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=ZF7ss7dJWTHLLa9FNsnYJO3c6WZwqwMms+ionVBB/Og=; b=AJw0LU4D0ehK9ZQoqTuvii1Ph9kTREIrcPw3Dd3w07225WclCzsnetAuGRnB2VSoxg OTYCg3wPC6gK4883KOQboprZ590KTZvJTyehNA0JaRnTo9H/twJ9/Tr7tx+nJAysV7v/ ++zf5thj7LFi7zapNn99HpcwgrQ4sScQhvcNgWk2LV8nAwex8YX3TjSnu6X+6ibLgDI8 7SsN1/86ol0NfHbsqNopZhGxnIna18pon6PHXllLRPc/kBW9Rq3ECCOwZSWIRe0Z/uzG x3kU9r/9OIWepkNqXHV9UxleLtvcrtIw2PfFxG7zC6UvLaX6mNKOntfEwP+kVcXMcztU gtAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622978; x=1777227778; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZF7ss7dJWTHLLa9FNsnYJO3c6WZwqwMms+ionVBB/Og=; b=jKO1x9vwlMjyIUe3u2be8JyvXHjzxmrGgyv/X2/usyHIiSY/yPAeoBjeczdG2+bw/X w2736RRgTGyfRGlxzlRm/TXIIEXr+GOlwiv4lRn5IDLg/JACogWrDaZ8OBp+wW1cLjOH oHirAUK0plpDEPrmCKhe5H/ibfMlEpaC51cEHn9vbEyIkyCa0CsF4M/Qv8mqwRfebAwd IiXT0U4wqCm/An8iuu6+ADkunxCvuoJ2JWcEOnPxIE3SJ4Bc3VVdJyN+2C+outZTs81S uVL3BR+bjrf5iUmMcaHrBPnQxfjo2sVi3xZHn2ZArrLPXaHz9lm76yl6+2R3VL+8+tR3 9NBQ== X-Forwarded-Encrypted: i=1; AFNElJ9ROKCcMMCAIqEuJ89d9/nsx4sg71r6lK51HRaEu9whlGlSGLCzrNB9dBSbg5+CDohVVEdIrZFOpljt4Oo=@vger.kernel.org X-Gm-Message-State: AOJu0YzD/GD/xafHeZtBLFU8o1iYVjbrpIFnkReN+ex9YzjBifXEVi6i E49HzPviZu1yn1DGRl5qbl9iS/SbkmWzjYkViDpSWrkSAUhpCjdUBdgDS6vVFYTVc5ytZzsrG3S 4nmyvszB91ibQJKP7JhUBaqTNBYzLD95cpxMSeRkDqOnVQ0yqd88QhWS68Fxz95ktRsI= X-Gm-Gg: AeBDieuX1TTkahJxD4Pn0JH9B9C66poRPkdppdQrGb736yaONp3d3vh1taNUdHf22cf UvgAXxWLJuuMa+V2VDC+NkiZvh7r7089+rh4qJkmxhdd4Nq6EnvkaNul4KkcL47prva4H2peOgi 8NCU17nPu33SVGX8FOBqir+9iOS10mrVsbwLsqWJ+Ub5ZpO4GDm+x0NwHeYXmCAHtVZct+rFBiK mrVc4bQoy60jzXw2KL3vsEqlV5K0WGLhwqfZI2/tavbJhdQbBGftT96uffQoQMmzfHnBbz2riTR hggJP9p4yPVPBFWd4FB6BsEvuy2nHbq7RFSzbINqSRB5fhv+ujVjG7UkMx/3Jopdu0asIVYTu06 jbTD/KtJY1i5N6O3mv77xSZlTI+Vs+GpRPDpZlrohm4d4fhl3VvS+HIMvNxnj X-Received: by 2002:ac8:7fd2:0:b0:50d:66b6:1564 with SMTP id d75a77b69052e-50e36943bf8mr171663841cf.14.1776622978560; Sun, 19 Apr 2026 11:22:58 -0700 (PDT) X-Received: by 2002:ac8:7fd2:0:b0:50d:66b6:1564 with SMTP id d75a77b69052e-50e36943bf8mr171663341cf.14.1776622978074; Sun, 19 Apr 2026 11:22:58 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:57 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 13/14] thermal/of: Process cooling device index in cooling-spec Date: Sun, 19 Apr 2026 20:21:57 +0200 Message-ID: <20260419182203.4083985-14-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: PuY-Xnf1R3LtQdGy8oKVYd5LUReF4-NX X-Proofpoint-ORIG-GUID: PuY-Xnf1R3LtQdGy8oKVYd5LUReF4-NX X-Authority-Analysis: v=2.4 cv=SNFykuvH c=1 sm=1 tr=0 ts=69e51d83 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=S3gQTLpqa8hfpVGigeQA:9 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX5u2M/SyKLz3j amTXFKWvC4rDQTkh7AYKxMxsiaytAWvt6jp5nsmCN3UJ+VgU6b0Y/yOnRZVm/WazBzHn+GKCdT9 9ol8ch/GHFujZgOn/TOz8eQgRferjz9C1xbnuLAUqvHOA5/7KSBp4G6dMjvQna/M7/aGqetuyty HDsWSNCaJEoO3LsJNXpz6johCmZu0sXo8iIh0wTI5D2Yxa5SkQgyOgpNLvWKV9FgbpX8jA2bTau 43FSeg9IBCvcb76q5cbI2zEiTCPxZtFW9XOOcyx6PVL6lzldZAB2jGmkGfVpow3WsWSl+QB4/jY oysx5XDsvMipHYuEoQQHZH83rSjBHkifXm1riaa2m5tCCGc62ImT8+7o4Ur/6YqZToaZK8m+01M n4OVVRVkU+pqCnAK9Dk4Uzdt3PituLytk3LNlA1YYwMCV1z9aXjRLcXwLd5ExboaXFkn5KeKNXi 8Y95LyRYSLaIXTZGlwA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" The new DT bindings format describes a cooling device spec with the cooling device node, the id and the mitigation limits. Depending on the version of the DT bindings, in order to bind, check with the device node pointer only or, in addition, the cooling device id. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_of.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index d9bd7dc01e19..e9b39d625b0c 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -264,11 +264,29 @@ static bool thermal_of_get_cooling_spec(struct device= _node *map_np, int index, return false; } =20 + /* + * There are two formats: + * - Legacy format : <&cdev lower upper> + * - New format : <&cdev of_index lower upper> + * + * With the new format, along with the device node pointer, + * the of_index must match with the cooling device of_index in + * order to bind + */ + if (cooling_spec.args_count =3D=3D 3 && + cooling_spec.args[0] !=3D cdev->of_index) + return false; + if (cooling_spec.np !=3D cdev->np) return false; =20 - c->lower =3D cooling_spec.args[0]; - c->upper =3D cooling_spec.args[1]; + if (cooling_spec.args_count !=3D 3) { + c->lower =3D cooling_spec.args[0]; + c->upper =3D cooling_spec.args[1]; + } else { + c->lower =3D cooling_spec.args[1]; + c->upper =3D cooling_spec.args[2]; + } c->weight =3D weight; =20 return true; --=20 2.43.0 From nobody Sat Jun 20 05:52:26 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 128432F744F for ; Sun, 19 Apr 2026 18:23:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622984; cv=none; b=IWKcUt0Vhw2xqCEs+tXKNlSk4Nog7WWDY1aws1ocvXg1hYM/eg7ZQVKQ1LXnOTp1LnhLnA5rs9NANew4NVOnNnBnhRd2qtc2RCd4fo0BeJb6OnvhV3uJVX8dXLXIKeNncl1nGfTbRQJlRJmcaiTxD3v3NilmPgu+qtir1ke9H4I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622984; c=relaxed/simple; bh=WzntAKrn3SE/S0P6q3sFoaSPnkduyAfvojxfo8h0D/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F0mbB2MwsHYVONBf3nJ0dt7huxXwtB/0mSdrswZ8sLqv41VQwyvIs33s81TtlKzVmBLPEtzLVKM6v9o9N4EtJoJ1bT6tJBMP/5cxjNsXeQaso6xdq1BWL9FoTZjijOVmA85IuU98kb1S3HdPP2XpENckkYTXc5qzk9hlOEQmIB8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Hgkh6xag; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KyJZ7Ljn; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Hgkh6xag"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KyJZ7Ljn" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63JFkNuw3562740 for ; Sun, 19 Apr 2026 18:23:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=/O0gxmkDAI9 OIMx5SPRWuVmH2AlYc/ZdPsgTg3SpEAo=; b=Hgkh6xagQ7VuzMo95XqD7wXM8EW RmfJQJnGYCg+zIr14mvfwXRiofcPUgBcJT1x3V2T1HuMu1bZ/9I4psqEwzlv9cPz k5lF9nwyVVIpQhownNXkMiTWDzeQh6OfHpte3eXiJ70mLmQZG39C0pfE/Ymj/DnA qCk+m/SiN2hpb1hrNRE6hV4JIyPgQzBT0ZPLZmIgH9emvNkFE3sGnYKqxKEz8u21 7r9/TVICyhptUNTv/Hq7X8CG7gkufNdf/lP6iP7XlctZY+yzuYNg1ic3OQc6ekf4 FeN9Fk+jGAl0p3nJor4Lm0lpa3KAQJy7Iw20yoya2PbXgkVNJkYkwLT+LuA== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dkyank9dt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:23:01 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-50e160d5fd3so53716401cf.1 for ; Sun, 19 Apr 2026 11:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622980; x=1777227780; darn=vger.kernel.org; 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=/O0gxmkDAI9OIMx5SPRWuVmH2AlYc/ZdPsgTg3SpEAo=; b=KyJZ7LjnQdmhr5hkI2I/xDuUZU46NZYDgRnSq9MQ9cxe+0eDZ+p1shMNvRDkpWDj+C aQX4lnpT45I9wx3/trQ5ve2/6W1l3F0J8nu+LcMxVg3ICAbvHMdQhDS7Rq0JSzhaR0Ie 4KzYEZXfIjG+YICK6lzUPuCkJNRXEZfuRoBmhYrKPEfYir4ybItFviniqfrSyNmZ3nO/ 54HY6tKSzd+rcEAgbVqkd26+FGqaWpSqUaGIYkgCF8W/moiSHKKj0uVcUd2iqrozMTrE +vw8fpJbaoz1iZgJ0XVMER/Rfz8fadMLMkIVQ8ANtkuYLCtKHnFF0wHfFfnNtxjMwqyM 55zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622980; x=1777227780; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/O0gxmkDAI9OIMx5SPRWuVmH2AlYc/ZdPsgTg3SpEAo=; b=fHbZwJ4hIEl7tCDjopm5kTpbRx8RtW6UfKqxCVYZogrx7D0PcVwDBrPJtKGn2/BN4Z obDpCDlpTeEJEBUy5Lk9tHSQG2DllllBOl7FC6UlTJCyTznaKRXwkf29l/gutnpuNKSF jhN+MrNgfAwnbKiuPr6O+2c0SFlcZ3lpCMPR36GWyvOmDqoGG9EbscYIoHT8qsUtBVdW 5JD6EIg/fyjQ+FWAE9Uq/o+fnzbRztgJT+h5//7N5w/KF46yDvS/6EhFA1+H+/nXc7V9 xCz++SG6exoo5H1sc0jAQqf5a0vBfRpzAbdBn5BTFpleFRmIn5Q0fNE2S/YTHlda4STt NmDA== X-Forwarded-Encrypted: i=1; AFNElJ/nSiTuH4ddZKBxVc7wJTJ/krmq0OOuYxGvATqjo+9lj2k3FVBPnVCTNUhMk66iOXWUHRi8o4A1MvzQC8g=@vger.kernel.org X-Gm-Message-State: AOJu0YxyOoyjv/Cd/c9L6ElEFtTrYFwU9u6P/g/8y1YVxHNz6+09ODwf va+/siFUbBBxLEaAnV9kEEmEF4vnj/X32KJ+Mf9//fs4Uet+6IoT4FwWNOxZQR+BMIBBj5cHNqt Skk9k9gn0vKkl2lLsqYK7mBtY4guggCZAH2uEqWdI8lAbh9aJrc1RqCVbk2dSmvXgFCE= X-Gm-Gg: AeBDievfCOo0iw/jUpZ5AzI/hg9flHKcFvEI080n8WgAOXvxr+pDYBqVH2M/3G94Qfi N6og8fW/wV4jslGDEUYfXFb50R7DaY0eNlBXxfKTEG/kMKM++ElGKERg3JgFFRjJ3+DB97NdhFe KQEGZEaQzjYZsNpYOWSMkPgbKmqhzj1cb+gf7HTgeqb69koL/JIHWGSczN10j8pnPaHQcMJ9fQk JlHdV/6P/Iw9Gq1yxi+I4xQ+ez8UAqsoyJmcDRRLK+AHlmhcI67tff5B1zNrmt25sUqKCVFxjME s4ErkPWe2t3MsoVlGicIMrnuT72+OwbFI89yufSJOqDaNbvzFh+s/qcVw6xFQJaD1UCp55+dv4+ 9XEXyw7cbw+nxkmDr3Y6+z+o9nFgSlsqAjQMxMs0aFfl4n/c5Q1mBrIw84Y+y X-Received: by 2002:a05:622a:a05:b0:50d:dd3a:73b4 with SMTP id d75a77b69052e-50e36c49454mr168590681cf.37.1776622980443; Sun, 19 Apr 2026 11:23:00 -0700 (PDT) X-Received: by 2002:a05:622a:a05:b0:50d:dd3a:73b4 with SMTP id d75a77b69052e-50e36c49454mr168590301cf.37.1776622980036; Sun, 19 Apr 2026 11:23:00 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:59 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH v1 14/14] dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device Date: Sun, 19 Apr 2026 20:21:58 +0200 Message-ID: <20260419182203.4083985-15-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 84daq0iRqyXTudeLQxUyY1jNXox_g9E5 X-Proofpoint-ORIG-GUID: 84daq0iRqyXTudeLQxUyY1jNXox_g9E5 X-Authority-Analysis: v=2.4 cv=SNFykuvH c=1 sm=1 tr=0 ts=69e51d85 cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=GhBi0EG2tKjOyko4s0MA:9 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX4u51b/1bDx/4 4P7Vt5TuwtegldVActhmdH3+GMpdRuAvtOai4DsgmNLw8UZpQiHt9VuJx4xLAWhGDK/9IQc2psI +m27SEv1K91KlAULa5Zrm0icxhAtpfLM1hLJVDksIHBiL69ViNb3NID29lWnHikBiEng38uuNax aULp0d0rPzPc9gyMslodgyQAC8bpAlzksnQ+LkfIumRuJ87+JPnvm5+Q/iGsfn4CIgomAkXrNpw yymoUjP4CMuYqJi4lXlT/4TEzWWFYe6mUwfQQjY16SW8/MpXK7H2FZ2zlGR5CeYENrzOcRaScz/ 7DsqDI7YclQJJNzjOyl9WGUpt2omR6OnKs559jf1Qk8GgE/VQFiZovNHOaisxNMLpHIjb7p6ur1 mJz5MNVM48UGYqrSMoS4cuV6yGYC8Nw6NDo4h2esY0wuHkhBftZRSK0wvIZ6j4ZdZ0WXyFE9kgr dLobSpffcEaC4tCRGwg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 Content-Type: text/plain; charset="utf-8" From: Gaurav Kohli Extend the thermal cooling device binding to support a 3 cells specifier along with tje 2 cells format. Update #cooling-cells property to enum to support both 2 and 3 arguments. Signed-off-by: Gaurav Kohli Signed-off-by: Daniel Lezcano --- .../bindings/thermal/thermal-cooling-devices.yaml | 8 ++++++-- .../devicetree/bindings/thermal/thermal-zones.yaml | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/thermal-cooling-devi= ces.yaml b/Documentation/devicetree/bindings/thermal/thermal-cooling-device= s.yaml index b9022f1613d8..28f5818f1e60 100644 --- a/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml +++ b/Documentation/devicetree/bindings/thermal/thermal-cooling-devices.yaml @@ -44,10 +44,14 @@ select: true properties: "#cooling-cells": description: - Must be 2, in order to specify minimum and maximum cooling state use= d in + Must be 2 or 3. If 2, specifies minimum and maximum cooling state us= ed in the cooling-maps reference. The first cell is the minimum cooling st= ate and the second cell is the maximum cooling state requested. - const: 2 + If 3, the first cell specifies the thermal mitigation device specifi= er + index for devices that support multiple thermal mitigation mechanism= s. + The two other cells are respectively the minimum cooling state and t= he + maximum cooling state. + enum: [2, 3] =20 additionalProperties: true =20 diff --git a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml b= /Documentation/devicetree/bindings/thermal/thermal-zones.yaml index 0de0a9757ccc..1261ba0e802e 100644 --- a/Documentation/devicetree/bindings/thermal/thermal-zones.yaml +++ b/Documentation/devicetree/bindings/thermal/thermal-zones.yaml @@ -214,7 +214,8 @@ patternProperties: device. Using the THERMAL_NO_LIMIT (-1UL) constant in the cooling-device phandle limit specifier lets the framework use the minimum and maximum cooling state for that cooli= ng - device automatically. + device automatically. If three arguments are specified, + the first argument is the cooling device specifier. =20 contribution: $ref: /schemas/types.yaml#/definitions/uint32 --=20 2.43.0