From nobody Tue Jun 16 19:33:09 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 D51823FF8BC for ; Wed, 29 Apr 2026 16:14:42 +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=1777479286; cv=none; b=imLEfAB5/f3/0+LmCdiJ6fE66MjxIIRTFEMhBmrEdLnFrN+e6Zya2Ll0a/Mxj0zIqcv92wp9BTuS18F09x/L/7oss9aIcXI102l++4AX/a0lFF2kf8OZoj7n3um5Kreg8h0nRTZkEVVz+VhY8q9Ow7pVjwzOULg3LMsIqi5+NaA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479286; c=relaxed/simple; bh=IU2MCLywi7WPT9xemBFBEzKAZ9qlZTenQAWiYNvqPD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tE0qCXqWrwyG3bmrKjvV5vDcqw30iOK/y2+Grmbzss0NaO7wk9dxbdFgSmbpOQKZS0Da+rePNe9NvrI2QRkx4dGYUkt7/lgpQccA0woe3RKGAndq9fbOvZihAZ+uSCqGO/oUVscMBfr9+0T6ry8Vh9i1GcxsbhOzS+tvgA5LeKM= 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=Wg60DPxX; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=JUVGMw23; 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="Wg60DPxX"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="JUVGMw23" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TCLxP32485196 for ; Wed, 29 Apr 2026 16:14: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=gE6qfjz1c35 S/sZOZiWzimGIx9b4T9mf/ksJNqxGO8c=; b=Wg60DPxXjSAuM0xqDSJNRrs8fuI VBTChIjBqaPhfeXfwtFd+GpP4TPnPvRwpeOslCFT/qB09q8LxoPRv6p097pZ116U VWJPgu2n1/DgXnOBQilB7fmEoNN/vakrXAChmmLFVQT7SY4vrNyatiX8wEBA9RYj laga3simhD3ZpMXHkZkfeumwWnsUketlLtsAzaTjS/X/IFE54j9T5uocsERfapZy imtJkwfPG3IuSWUsqsDW5yPqvG6fgcACxqGQe7mrjRg0MGITpjALKr9fjQgbDY1o zCZ6/a8Z2UbHLg/bdaxUjXjjGE/yLlLkwIj77CxfqhCYe84ImhrMzozLuhA== Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duhx90vym-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:41 +0000 (GMT) Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-56f73835016so10860107e0c.0 for ; Wed, 29 Apr 2026 09:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479281; x=1778084081; 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=gE6qfjz1c35S/sZOZiWzimGIx9b4T9mf/ksJNqxGO8c=; b=JUVGMw23gXiSu2pbxihNendDX/9SOrlKu0P5cFpsUbdTaODVCy0vNPYLyr5tR1gKSs c2D+FMt8Eo0cJ3eK91DlQccZ3t5KaqYe4DOO/MAiIZ2ApYDp0X0l3Cgd5znbMjClMCDV vdwa5E5u1lLtbFxwCRICLaHSYqKqqQlJsE+1qnTSVMcJOJtvx3jrRxzKKb4KViMcYKx3 kX2zd6H7rXpJVnJpz1XMlYbApYmpjcE8933/UDyrC4j6zlTkO1SZOuidnIi5A94OXCCp EdM2vDAk3pmOysVHQ5fPt/gdB64YoCiTVWj2lmy3o+NqQsDetw5Usr2fXlrYPZrsNpx3 QrIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479281; x=1778084081; 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=gE6qfjz1c35S/sZOZiWzimGIx9b4T9mf/ksJNqxGO8c=; b=GBq2RA+J7pxLaP9UDghrLUF0jxvvNqnkE8IxvTVBFdDURJMDINaG0d3kZ3u9gJIlkB TaT8HMV7EeNm9XY9gQIt9STqvLD9Rk/Xo7pZ/5Ut4G9ZQOHX8KLkiHxh/Y+QKIjZoRz/ WasMgqR6wqmztaT8mklt610Vku/YDorWxJt+kg+aeAHEKblZPEu2PXKMLjFCN8jpaNIy i434TBlvj6xX96fu1THVsugEXLklT+KclmUVrrySL+O0qH2dnP+vt6xh1C77+VLsGkAX YgHPRqNLTi+x8GIVkPGl0Hbqh4TOcwJx8aA2AyGbmZQGrvq5ZlwooAYB4Td9hWFVNF2R zhxw== X-Forwarded-Encrypted: i=1; AFNElJ+wia+7pXaU0evlgkR7lXIN5a6Wv0pQXvB3C87wcf27itrx+iyN0SW/wgGiFF8sqr/njFbXQ124pTken/s=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9E64f4hJ4OtfurEScS9sGLQes297Ww/qwCwMaVOTbLGQGTM3G DnKdIf8KQsgoB+NlQs8ldf19Dhva5nmLNuqoXvF81LFLavJg2eDgrA3gdG3z05RbM2F0RGahszR rQsxnDW1SuC6VhGlLQhYbiM4edGs89N314ls0FESDtJxw6/sFFD93HKCcGMlT/6uEcVs= X-Gm-Gg: AeBDieu/ZhVR8S1l/Jj5iBsa6ON6RSfxmUZ8MAn0e+JQ56qxeXmee6Lp6jkA40wRSit j9qB7BXY5IyaoOEHGxbSeDMhqal06aEG+X0IFf/xgcgE1zOuAdW/P44B4NJe63gpnhyOzlBYxay i5Sx20kyef6jFKsXzYX85oi8xoyDZwkCijSyWhLldD1kIuuhWxOi2exsfHS0yCDujnPwiHOg7ad QS6UlM9JpGODW3UNQoHlXNmPw4pAfJodY2RQN46kUn1LUvGPUb11fvEU5/OzEhDs6Y+pvHl7rrc kMPoOYKvJYf7wJOqf+VkCxiBcRX+1zzp1CkkGGo/IZLN9GPDaxepDcQkHQhcKRwZ02T2Rx2FBRG i18VHrg8H0BADbinH3iiK5TS01kwfpL1MaiO2zVt3vef5yCqahxbQlnNxzpLE X-Received: by 2002:a05:6122:4f9f:b0:56e:f876:5626 with SMTP id 71dfb90a1353d-573a556f6d0mr4627321e0c.5.1777479280768; Wed, 29 Apr 2026 09:14:40 -0700 (PDT) X-Received: by 2002:a05:6122:4f9f:b0:56e:f876:5626 with SMTP id 71dfb90a1353d-573a556f6d0mr4627240e0c.5.1777479280360; Wed, 29 Apr 2026 09:14:40 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:39 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 01/11] thermal/core: Use devm_add_action_or_reset() when registering a cooling device Date: Wed, 29 Apr 2026 18:14:14 +0200 Message-ID: <20260429161430.3802970-2-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfXwFCnBiq+Xs/4 D9VyTIMaKL1xdhwzNIAELvN6cXXB/x8pEzBPAO9QeBcIvC0Vk2eOrnNEFJLR8MDWCZlbXo6xW4G abncQDFLZ6UvvrV2ieLR0H1l2SqlQTOFQrlgBXbxABkU3eVd5VCpTgJ3TK0wXl88y4gqb0CUrPa yVdrWn7awE+HqEKSQQGsoeXNGvcv2YKreU8tXkb0uvZj5d+oLAzM37SsgxUBRQTkRynTf10L/xW 3IEgoEjGjR12Hi3Kg/XHcb+nxHxo+ZbTZGF92ZSH8cTjjfu0vIQAKyFcJyow929hA8SzNyMXiyY qJI28HeabnUj9ob96WZAwxtZ1nDpvmzdSXkSuCeyHGoChyKriQfNkT70TLXoZKZN3AAjcL8Q2ar dtb44J3CYc6tKCW6Ec9H7Z1P5/opKKhYofVkEdOAGvk3W1gau6p6A1gymZMRECdXLetm0KbUZgy HD3+gs5YxEAFrOsdwgA== X-Proofpoint-ORIG-GUID: 395JO6R8b4Mp205Iivr7zshQJHNMokZ4 X-Authority-Analysis: v=2.4 cv=O5oJeh9W c=1 sm=1 tr=0 ts=69f22e71 cx=c_pps a=JIY1xp/sjQ9K5JH4t62bdg==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=99rag_Q9uAacP-dHLx0A:9 a=tNoRWFLymzeba-QzToBc:22 X-Proofpoint-GUID: 395JO6R8b4Mp205Iivr7zshQJHNMokZ4 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 Content-Type: text/plain; charset="utf-8" Use devm_add_action_or_reset() which does the replaced code. It results in a simpler and more concise code. Signed-off-by: Daniel Lezcano Reviewed-by: Rafael J. Wysocki (Intel) --- drivers/thermal/thermal_core.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 2f4e2dc46b8f..664a4cc95199 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1187,10 +1187,11 @@ thermal_of_cooling_device_register(struct device_no= de *np, } EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); =20 -static void thermal_cooling_device_release(struct device *dev, void *res) +static void thermal_cooling_device_release(void *data) { - thermal_cooling_device_unregister( - *(struct thermal_cooling_device **)res); + struct thermal_cooling_device *cdev =3D data; + + thermal_cooling_device_unregister(cdev); } =20 /** @@ -1216,23 +1217,18 @@ devm_thermal_of_cooling_device_register(struct devi= ce *dev, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - struct thermal_cooling_device **ptr, *tcd; + struct thermal_cooling_device *cdev; + int ret; =20 - ptr =3D devres_alloc(thermal_cooling_device_release, sizeof(*ptr), - GFP_KERNEL); - if (!ptr) - return ERR_PTR(-ENOMEM); + cdev =3D __thermal_cooling_device_register(np, type, devdata, ops); + if (IS_ERR(cdev)) + return cdev; =20 - 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); + ret =3D devm_add_action_or_reset(dev, thermal_cooling_device_release, cde= v); + if (ret) + return ERR_PTR(ret); =20 - return tcd; + return cdev; } EXPORT_SYMBOL_GPL(devm_thermal_of_cooling_device_register); =20 --=20 2.43.0 From nobody Tue Jun 16 19:33:09 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 21B993FFAC0 for ; Wed, 29 Apr 2026 16:14: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=1777479289; cv=none; b=YoOguSYe71eRE+z0X4tkUYyE9ggmuoFcnmS6u1s5IqbRRkrdA61jtTN7LE4DO1kyBwwIzkUvp7E1pXagOdrgPHAuuGn3VGFXKzd80RHc+nMOzLz956f7IS44lpq5uhBKq11xyp5UFep885S9oXcYB6F6vzlx9Mc/I3oy70WIuKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479289; c=relaxed/simple; bh=GMW15JQKvh68RISGmBmQhQtahGk5c0uHc5SrSpqibxk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i1TOT+bKOmE1bQ++FOY9uZuz9JZk9+LFDdyGRx+IH4Nb8wn2kjaeUd6iaOUEMNs3O/6RgdGb0ipr7kLNJf3s2hD7CVPN+j+KqOee3yYA3pVOSexIUBDggHKlDE2WcBJu5s9ZFeX50QG1p1L59O/P7SpvKFXOT/1AJZUGhawajEQ= 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=Hu62zZRs; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XhSfUpDT; 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="Hu62zZRs"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XhSfUpDT" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TFTjnL1641981 for ; Wed, 29 Apr 2026 16:14:43 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=knJvi0AtUY/ Bcp4iZX+go0eWYlAuBgaLg+IAzj9hl5U=; b=Hu62zZRsSuI5mdtp2s46mby9gS2 KSAkAKoaRT+bhvxTxekRT4klxPG4w4RTrvp78ZNOT2uir2IodOtTKpcZgK/zAtwJ +/IKmMvAnfrwBEu/GQKqVbA9zrz/iRvSjPGEB3dHGv7fr6dWMm/NG5E1uT1oOisc a3nQYQCoQBiRhvhkJk8b7zUi0/eVKw/LVmAWrZ6Yp2ln3RFtGmyFRh1OTLcjW6d6 EsFlMSuwrC8XA2Q9MOAKR29nyw8LP7AOMOnVQ56ZiiSAzkRhm+NI8RRLqbyyPK2S qYXeFo/MkL5o4CswHlOZEmonv/x1nKIGIS3/zrwHV4B/wzs7xvdAyzj41NQ== Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ducj82dca-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:43 +0000 (GMT) Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-56eecfd79e7so25414081e0c.1 for ; Wed, 29 Apr 2026 09:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479283; x=1778084083; 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=knJvi0AtUY/Bcp4iZX+go0eWYlAuBgaLg+IAzj9hl5U=; b=XhSfUpDThCaO7LgdkyZ+juE15I+ZXKSmabJM9FUOw6ELfC+Zg9NeVZJjDPEOydeaxV x12H80crWANaD4bJgxSGnGbX6NfyZStzy9pfbysiOj71qaUvmIIo1IBl8s43s04JwTym phDZ9U41uSPxdYttxfrKR23NQ90Rtu/AFc+I11GeoiF8pAR0cimuB5GESGOVnn8w9dOr ZuGrqmHHiM3KrYCyB1ceBZkn0XjvpSsjoqMJ0rUUEipDFLinuIugCMGp7nYF3PmeqRbo IJxnuOKMZCvn1b0U+ze0LG+p3Dc0GeopKTBeKfxDI+1qTribe/x0ujx8mr8E7kGE9Xwi WZ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479283; x=1778084083; 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=knJvi0AtUY/Bcp4iZX+go0eWYlAuBgaLg+IAzj9hl5U=; b=QcjwpTpiuZwjsMUnZ8fo6EzKrKzdj7ZTPt61/v4OVkfuojZ3+1OtIIssSnKTgVL4pX ttgq5YmO5n5Lt9+H/5zg19oNfS+FLBju293y4pFOdvkoeTqN9tprH+ie8w4ILOFfJoib dZcVfKLIZ568YMpA+Q0+utFoAg9aIBPWgxy9ZRqo6zNSWe7oRdpZUYBzf8S8td934hby 6AO00swAlhA/DPQKoW08CGSR8PhniNQMb5RMwGilCH7zcfR06ZZq/QbAnots7Bu/lRMa s4gJll+d78InYyx3BhfqR5nEzyeXgnVZby1LS6iYsEIpuNdF3uVO32y+x/JB2Mhpe1qh lxHQ== X-Forwarded-Encrypted: i=1; AFNElJ/w30LrgQIjh9l+5J3rbU2/n1HH4GX/ig3FD06tZIsORfeuPPaJMkLX56mwYE9uAgiOYWcUf60tM+ysmTs=@vger.kernel.org X-Gm-Message-State: AOJu0YylomHQpyCYLXlQmxnZeEMzfha5nLo87DDtQmhJw80lii1Dg8X/ tBzM7i1o9WDFgLzJ1yk1eauebLAzg7Rr1KWeaqEKKiWP5dc7TEdLNKcx4ZzLsiQGLx54jJsaRzM 3t65nZVgm3yLgqIm6hd/miw/7RcQtpCPpGQTKsZT29O40sa1QCJ0eTae5JyZ+LTEHV/M= X-Gm-Gg: AeBDiesnveSLYXlkdEdxezS0S8ZZaEMResdit/k5CuoBhZmmh18vN08/t42qXbqJJfn 4TuZM/+2439Iny4zXz4j/a/t1+rMeT6nZqvFiNnniMpLF+S6e1DZBf6Wn2dhWJehsVAFAO4b6g9 xGXFKaC82EFOWj5n31lYXDpEcIIRFwipMHfcp394W5fmdiLYKHiVSf1/S5IJixnt0JB+LBL24ar Mf1MpVZsiR7CQ4nc5wnS+WiOeyJPMJCTmoD4xkK4ZhfHmYJ0s0kBiA+8qnm3/hoUFs2TzV+7upD 7xM94mPquU+/618+YTDnHvVtQLM1HZPxS8wPbPwlKmdftrkTEr3qROQfEkBFYG22nogMmXwx5Rl h/K26M8pKAjDax7tl9wypHovbOzkO0FfvepVqu2+aW2EusNBTotz1EtLSs9JO X-Received: by 2002:a05:6122:179b:b0:56a:ef51:4cae with SMTP id 71dfb90a1353d-573b348ac72mr2720494e0c.4.1777479282905; Wed, 29 Apr 2026 09:14:42 -0700 (PDT) X-Received: by 2002:a05:6122:179b:b0:56a:ef51:4cae with SMTP id 71dfb90a1353d-573b348ac72mr2720438e0c.4.1777479282359; Wed, 29 Apr 2026 09:14:42 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:41 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 02/11] thermal/core: Add a non-OF registering function Date: Wed, 29 Apr 2026 18:14:15 +0200 Message-ID: <20260429161430.3802970-3-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: e_p2vi7UHcawZZRIKFoqLVMAxGuS6zDe X-Authority-Analysis: v=2.4 cv=RI6D2Yi+ c=1 sm=1 tr=0 ts=69f22e73 cx=c_pps a=1Os3MKEOqt8YzSjcPV0cFA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=AEQiIq00j7-0rvc0-mQA:9 a=hhpmQAJR8DioWGSBphRh:22 X-Proofpoint-GUID: e_p2vi7UHcawZZRIKFoqLVMAxGuS6zDe X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX86YGbN0SPjFU xZ79wXR3eWBt1kISJhoZ/89zYcThKRTDQDvHKQRX/AzbUsKboqHMfe+jZj62OpI0VF3uypRVaOv d1689a4kL3VtxU72K/LIQ6BFq0311dx3o20PvI534v2R4eKD2CF4mLb9adX/49vcKRfHvS0MlJb sWx48U+SdCOP3tQuJm6q1ovGshBbnZ41zCPCn6MCDJFVyR39gJFOwIMyAMhEC5+r+oMneO07Et6 EPWABJD169yB0jfWAqdEaGm1rESLY5YivRm4xNMqdwsuHqXKby05/JyLbsQ07I/PKPwiVBco8Zo aJqC/d5u1vY4ETXroMXz6dJgmu0I88OcfQ1wnIC8bpbP3CyYBUgQBBaEBMeBkUdS2XJOzYThjVk pqdCaqga18SjrDcFN3hMyc7+WOA5fCRpHDcZdMXgmsqRjHuntJ7kJxSFQzKbK2bQDvSmX/tjFHz 4y5SoEtNToDc1F/U82g== 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 bulkscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 Content-Type: text/plain; charset="utf-8" In order to propose an alternative to non OF code registering a cooling device, provide functions which are not for OF code. That sets the scene for OF and non-OF code split. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 35 ++++++++++++++++++++++++++++++++++ include/linux/thermal.h | 16 ++++++++++++++-- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 664a4cc95199..5c954bcae4a4 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1194,6 +1194,41 @@ static void thermal_cooling_device_release(void *dat= a) thermal_cooling_device_unregister(cdev); } =20 +/** + * 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 *cdev; + int ret; + + cdev =3D __thermal_cooling_device_register(NULL, type, devdata, ops); + if (IS_ERR(cdev)) + return cdev; + + ret =3D devm_add_action_or_reset(dev, thermal_cooling_device_release, cde= v); + if (ret) + return ERR_PTR(ret); + + return cdev; +} +EXPORT_SYMBOL_GPL(devm_thermal_cooling_device_register); + /** * devm_thermal_of_cooling_device_register() - register an OF thermal cool= ing * device diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 0ddc77aeeca2..50b43e328ab9 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -253,8 +253,12 @@ void thermal_zone_device_update(struct thermal_zone_de= vice *, 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 *); +devm_thermal_cooling_device_register(struct device *dev, const char *type, + void *devdata, const struct thermal_cooling_device_ops *ops); + +struct thermal_cooling_device * +thermal_of_cooling_device_register(struct device_node *np, const char *typ= e, + void *devdata, const struct thermal_cooling_device_ops *ops); struct thermal_cooling_device * devm_thermal_of_cooling_device_register(struct device *dev, struct device_node *np, @@ -304,6 +308,14 @@ 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 * +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 struct thermal_cooling_device * thermal_of_cooling_device_register(struct device_node *np, const char *type, void *devdata, --=20 2.43.0 From nobody Tue Jun 16 19:33:09 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 4CAE53FFACF for ; Wed, 29 Apr 2026 16:14:47 +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=1777479291; cv=none; b=abW0p5n8Fe5LJLr7OG2ILR7wSJQzVKITkPNAZNFqVKF49A/xrI/eeNH4pwm/EiDtP/d/RmeDs2zB7lJSoJ3MfJdfrvaeAWg59mHNgUzDnjOon1Crg5voQu8TXxlMphBsy+Et781mGGb0tU0Vv0Hi/EO4j7btFNRi8SNT2xiqQ34= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479291; c=relaxed/simple; bh=ucaCDj4JwLttK9kftItHCJtiuUaF4EVrTaan65KQiOk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZOWeGuAtK3HqtLQgRKNBuWRIATlrecNFb8D1SI3phS7ORlv1X9ePpkjAduXxrRiGUiLhTD3IZ9+QNasHtJSEZAv3PsNKeOzL1UM3wyyUxhXlrrcz0iewV0jx9S0LkCYSPb2ruOB3cYQTJm84P0OWgdjMgW009hmxt4tS5+ZET7U= 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=eroR2myb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cuHtKjLD; 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="eroR2myb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cuHtKjLD" 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 63TFPwuI2094252 for ; Wed, 29 Apr 2026 16:14:46 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=zntdVnn2QBA NBiRKm99c9eG0gPaGBihJjkVAd8lHTuk=; b=eroR2mybXRWp1ZtSzUvF4wmF2wZ TQu48TtAK/2kK2fN4sRkekLTPRGpiVKsq1x0YyLOw69JdtD33G1VEUtyZGx6oul2 Qy9ulDh/PFO6GwI6stJj0uJxeVh7u/mmAPOMKxGMMw/12TPoOI7bv77sLPpnJi8k cSdM5oV9p+VmoncpjwYwrzM8Kmjb8z9hrWbdOfNHK73NnyACET1jTy5Die1g+oLd 4RJ5hbdLGgTEdpLyYR9rTfQLKLiRDE/6gyzCGQ2LN5tv/OkF3TmNs0YSpb8mN2QF 255KB4ut9FQyVPnEVOQu7r1pefpDNJCWquii4Ou6R1Lebe9SPpLj2JHbb2g== Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dudh3t64a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:45 +0000 (GMT) Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-56fb91588deso8513781e0c.0 for ; Wed, 29 Apr 2026 09:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479285; x=1778084085; 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=zntdVnn2QBANBiRKm99c9eG0gPaGBihJjkVAd8lHTuk=; b=cuHtKjLDZJGSdGTi+mudqv0da+4f62QgljJfL7x6ufrS9Xg+e4HGL7u5z8fjJaqrGP xJuw6pESgOEsDxCashd+16hX7nFA75eTS5sTzw5e/tGev2FJm3SMuxd80FNmt8jWgBra OtSqXROO1fHAaQIcyZ4G9DZaJvywbnFhF4cj94Kh6pd+w7S1nmBDJcuOXSmCCEkbSbQX e3p4yiZQ1OJYat6Tvg1RDQsds4gzXalI49IBi9AMt48AduNff0/uFLSAUr3C4pNOTmf1 oK9mUFeIAzSUtVaY7vlY02TRKwZDYraPC5KtMPOoxrVs+YLgamEA7oifCIgzajNW9gBB ui+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479285; x=1778084085; 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=zntdVnn2QBANBiRKm99c9eG0gPaGBihJjkVAd8lHTuk=; b=BLv01JabkUqFfVhfxCLczhn1OMRIr14RoImV2119mnSrXoQ8C/fNIGljcPFIqVJ781 j0DmpuF+YZHryM8G/zwrEKaYJEOxcN3WqdieCjzlO3vRztOU6NS9MfSqOeYZbJAlxFaR aw4c/bBRR9fQB5tS1UO9JHxv/+C72bKmijpSRDmNTQljk0tPOmhHNiVSEIbRTedzha1o i6D4JUMBFUle4ll+y/ToF1m91rkSoZfZlkkyT4rTwte4/dQErb6lNL+WpA5UX7lyjkKX REvxnLEr6/UrmFXRfPDkel5PSUa8rJHG0RyrU1h7l+iNY3uqg+05VCKu00PXHcaMNqk0 sN+A== X-Forwarded-Encrypted: i=1; AFNElJ/hMKuJpkkekM+xYn61vVMTUTAV3yaPWWkb1zJU5ShbSE8GFlgLKEO5SvyTtERtZGQEbqMf6bxomw/IQYE=@vger.kernel.org X-Gm-Message-State: AOJu0YxZUZT6S5ODohIxJybmVR+Eq8Dl6VO3Mat0pL435wRtjBAg0b+X 1eWDCqLfCzWySec0j0Jw3DSOWWz3vv/UzgxH08J6/wMBK8JNQhi8ahisq2LGtiwWektoTWp+/w3 IMLNlpd/YYdnKTKlCMm9N9OCCXk7yRL4T58oSY03g/SdLGVcBHWbs9IvPOvIfhE45nK8= X-Gm-Gg: AeBDieso6Rpfn+9INTiLA8/lJF4uszdhn4XmyMrQ9ww/H6JG8NSkSuajkgecuw7NULy 4axHj67krv9Z/4cLYwSAnv9Scg5upMtx5E54RjAS7e1P5sTLSrgE9RQaHy30SaiECxDYo/E/JRW EElkRpqrRxDAmJaQrcnS62rosquhQzjJaQancukCYxDW/TINM9whXnRnnkw0xPIfmpAiZwy69Xt /o5OhKoRB0y5pIU5A1Bhcoji7PKmtmxynDTs0Kp7PZ7s4vxabsxrBr3kWaxh0bx32k28nz6IbTi YfI/VOibyznK3H4eChyZLx/qqURc3mEjKXiV5ntbX6/VO8qQbmSWWSsqknBQE8fIA3xe/As5qid e7/jb5dX1vwTWSdrDr8PrcWReL7Qu+RgUnF1qqGX/CVB2b2gU6/yYRMLsCvwY X-Received: by 2002:a05:6122:8b06:b0:56b:a673:27bb with SMTP id 71dfb90a1353d-573a55d5522mr5018175e0c.8.1777479284719; Wed, 29 Apr 2026 09:14:44 -0700 (PDT) X-Received: by 2002:a05:6122:8b06:b0:56b:a673:27bb with SMTP id 71dfb90a1353d-573a55d5522mr5018099e0c.8.1777479284231; Wed, 29 Apr 2026 09:14:44 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:43 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 03/11] thermal/of: Move the node pointer assignation in the OF code file Date: Wed, 29 Apr 2026 18:14:16 +0200 Message-ID: <20260429161430.3802970-4-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: ugezUu8XenkSaQammwaQnSA6Zf7BU21d X-Authority-Analysis: v=2.4 cv=A4dc+aWG c=1 sm=1 tr=0 ts=69f22e75 cx=c_pps a=JIY1xp/sjQ9K5JH4t62bdg==: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=LI5FT54bHBAbo1Xzr3gA:9 a=tNoRWFLymzeba-QzToBc:22 X-Proofpoint-ORIG-GUID: ugezUu8XenkSaQammwaQnSA6Zf7BU21d X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX2BXnJbSBgvV+ nhCp+z2G4fGAQ/XMxCMcQygXjd7+s+MI08dEZc0cmB6zE0zXjWDr26TWd5p2WmfqOTxaw3fhjGx +l1sJFEsPmlAmuPPy1Nr8WnFNT2pkL8wI/rRMFAUgwN2fYAscAUJuMj6cygR3bylm2brltVvoCU BGWy/s/Qaf0Vyz/qX85rTqjI0OjCaQvkNKGDhCfDm/J50lTs2CcpfWpuc3DzMjbu1cuswD4+O3P XfEy2W2WiRbSEUaVQ8Sfg5iZYpzde7VNPm1eWGYKFb44P0hnmCzMQiCx8DIw06r0yAMpbrxHPaL WwB/wNDLsv7IayuYifZjAWHV9finflpmZpKCtG29x0w+SVSkDRWZ9MqqbPb6sDUjjNB0msaWmoD bkVMSJ7zQZkhTmPT59zoADpwoTy/bcN97Wm4gRmE/v2cAw5U2UDg7XdYU1afdmvJrkIxXJ9PqNA nIIY97JsvjHo9UpRTdw== 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 | 51 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 5c954bcae4a4..7867e6bc0a6c 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1040,26 +1040,11 @@ static void thermal_cooling_device_init_complete(st= ruct thermal_cooling_device * thermal_zone_cdev_bind(tz, 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. - * - * 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. - * It also gives the opportunity to link the cooling device to a device tr= ee - * node, so that it can be bound to a thermal zone created out of device t= ree. - * - * 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 * -__thermal_cooling_device_register(struct device_node *np, - const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) +__thermal_cooling_device_register(const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops, + void (*initcb)(struct thermal_cooling_device *, + void *), void *data) { struct thermal_cooling_device *cdev; unsigned long current_state; @@ -1089,7 +1074,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; @@ -1127,6 +1111,9 @@ __thermal_cooling_device_register(struct device_node = *np, if (current_state <=3D cdev->max_state) thermal_debug_cdev_add(cdev, current_state); =20 + if (initcb) + initcb(cdev, data); + thermal_cooling_device_init_complete(cdev); =20 return cdev; @@ -1146,7 +1133,7 @@ __thermal_cooling_device_register(struct device_node = *np, * thermal_cooling_device_register() - register a new thermal cooling devi= ce * @type: the thermal cooling device type. * @devdata: device private data. - * @ops: standard thermal cooling devices callbacks. + * @ops: standard thermal cooling devices callbacks. * * 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 @@ -1159,10 +1146,17 @@ 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); + return __thermal_cooling_device_register(type, devdata, ops, NULL, NULL); } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); =20 +static void thermal_of_cooling_device_init(struct thermal_cooling_device *= cdev, void *data) +{ + struct device_node *np =3D data; + + cdev->np =3D np; +} + /** * thermal_of_cooling_device_register() - register an OF thermal cooling d= evice * @np: a pointer to a device tree node. @@ -1183,7 +1177,14 @@ thermal_of_cooling_device_register(struct device_nod= e *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(type, devdata, ops, + thermal_of_cooling_device_init, np); + if (IS_ERR(cdev)) + return cdev; + + return cdev; } EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); =20 @@ -1217,7 +1218,7 @@ devm_thermal_cooling_device_register(struct device *d= ev, struct thermal_cooling_device *cdev; int ret; =20 - cdev =3D __thermal_cooling_device_register(NULL, type, devdata, ops); + cdev =3D thermal_cooling_device_register(type, devdata, ops); if (IS_ERR(cdev)) return cdev; =20 @@ -1255,7 +1256,7 @@ devm_thermal_of_cooling_device_register(struct device= *dev, struct thermal_cooling_device *cdev; int ret; =20 - cdev =3D __thermal_cooling_device_register(np, type, devdata, ops); + cdev =3D thermal_of_cooling_device_register(np, type, devdata, ops); if (IS_ERR(cdev)) return cdev; =20 --=20 2.43.0 From nobody Tue Jun 16 19:33:09 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 115A43EFD26 for ; Wed, 29 Apr 2026 16:14:48 +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=1777479291; cv=none; b=WV7m6UaBM51eRbsg61Y8NW824KpeE+ZzNWsgQj1JVL8O8W3uN1LUPlWLy8zrBrMx2gF9HT3ec3SnqJIwRlmcFD3KhnoWVvz/ZM942qL+1jPAwBkrj0/ShVktQwegCdDeU/Im1DujlTtXRtxYfIm8tb0IJuaeRuOZBWfZDgq9pnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479291; c=relaxed/simple; bh=j+dZZjvhX3/uWmfqgcfNW8B38xnfwi9TQ/BZm/YnRHQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=trPYbb1tTM0Bw01t3TnwRz9WSZu2tb1wohpTbwlpDt3vRNXxvxnXctAQDsV4E+RAMb2VMRFPlrCz8u7n+0evyZkWMzy+5GxuiF/ToUQ4ZydUz4J0X1LeJia5u+AP5OhX11grCJWwA5TY9FQydmcyYUGP4Eigu62yw5YWTh/yA7A= 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=XzAoSMb9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=knCW1bVJ; 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="XzAoSMb9"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="knCW1bVJ" 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 63TFE4cd1728556 for ; Wed, 29 Apr 2026 16:14:48 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=QzXG7s0ro7q CMWOD8nEVlnf4H7DSkLvufeY3TSsikco=; b=XzAoSMb94Jjx2djznZFI/GiHPzd 0wpZslkvTKqC4BPh//sY/9WpNVsBGp0oPuKHEbotnnc6k0UYD/fHTfOuu54JNhu0 lPpo2S1c2EFe7EK5QsyhN0NlJXCKdj6MZ0VON0KiIOh46xG5MN+QWzHBl7uEU3WR BlHj7KH2YT38M2YkTYO2LyfcgR81kQZF42xIX6WPewnd8dOPXvca3VIszrjbBVRn 3VtfAeLClAoAz8MWBStYLSLZk9O/O0zoOJ9CMXt+dpYD5dbStbuyoRi1LVwnJhV8 OQJSWjnIYFtB+I0U1wMPhBNgR93rI5rDKpTdFOuGqciqkCdtwVx7JjAAMog== Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4due5ksw36-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:47 +0000 (GMT) Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-56eeff9a2e3so22070258e0c.3 for ; Wed, 29 Apr 2026 09:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479287; x=1778084087; 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=QzXG7s0ro7qCMWOD8nEVlnf4H7DSkLvufeY3TSsikco=; b=knCW1bVJ5vlV8ZV8bGUgxvBNLJlgU4ZxgkbC0qDap40gXVuojJeAnOE/mG1EO1TjeI /e7rV0oM+7/8WKZ7e5ct1Z59bc0Y3DcHtL52UNYUEUzVOaZBfkiUxYAmppjgMGkYboXN hHZwhtUAjZyu8xeGzhmpASVIUmKFOKBLtHBRtDgNBTQA3lNis60FKRas4DCkubDzpHin u1wD57/0aBT31XZBZ4Istu7SiUwg9xE8fbtknirHww4cFWhH6edQU/7lZgJdjElGWHqR roAW0nFAoSX/3fiM2uAPT/5nQQ5675ssP56R6uOpKJs0qjGdgOQgEhaWwuVFkVWtnSE/ CQpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479287; x=1778084087; 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=QzXG7s0ro7qCMWOD8nEVlnf4H7DSkLvufeY3TSsikco=; b=fdGxMfK+iCDQTthZpSE36GVZqP4ae3YBSYMmMN7cw3s1Qj3ADNu7GE1n6hRWX6I9TD uF/AZ2cbQ9Ynsi2uZk/LSEGGPpxYzoyBzAOQJbYgYt+iikOzbHHEobZxv8YXgCxRLlY0 t8E3HGIWI+90AwXA+tyBRuO26ktAScPwA6uXrUn38rzcB6d0Z83e/JHhYM3PknV/AkHs 8hDr1jk5sVAgxJxQ0vUWO4zjh9KQpOcIPXi6cnD4m4LNNytusmGkMRLKoj+WCk5aUTsh SV0VvP3RQcNuZV7iBIbxBR9ChuIS+pQpOG2EcNsBZK5vXd+aRI74g2E+MWGV5cS7QBzE WRIA== X-Forwarded-Encrypted: i=1; AFNElJ+iwDgBkbZV0sScjbO5SCqvyhB1eaTWLtmkYoI8v/Zrr9hRaLdoU7aap8bw1onz/K3/UVb1vrCmuIGXBfg=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+MjGnQHUsxLKizI4JbpgOY+tcCs9X777RRf37cMAn3sDWhFvG S7ktjdBdfFJPv5y0SuGiNXPQCte3DT3p4kJtBgtB1/Yg1cpTwa8wLnCO1UyGHFrlXbUnbRxKr2Y gCXIK89INMkBCjNJOKegFrItATZ9azRTKuVXP620tsCi0WKxmAIKu/cODa41QTkVGN6U= X-Gm-Gg: AeBDiev5R4PM7EnqLVyJZuFFg1sHpwsoSGUZ8x0zyoCbpjilnQ3ZkcULPxhy6QPtNhf 11Vzhqy4OgjYJ/YfK/JnDWJcuOsf/20QxG69GJ0K9ks7DwlHHNsd5Daz2/0/YmYyCAuQUs116GT Ymj5BpUwKEDY0Ks6qEyWjrd6vfJIA5Zggx28YWg2JJAtRv7NISchQ17gl8a22Hbg30lmBkx0lTB Q0SP/9d6QEX+n1tq8chiS7xEEg6Z06QRAOBxrsyLgzfcOn0CS1yb1k73SbIzAZBT4RGzVlHXYl5 YjlUt+xROWXFJgld+vfv2ddVRP4n7TGumdIK/4uMODrCU8qIiDwurgfhzyWLNUsJ7WISfvgj0sz nn5AGk66iIXcRuY3lMn2hoE1yeGkPkCRRdFXxjVwuftZq/KzNkBNDrfn47Ges X-Received: by 2002:a05:6122:288c:b0:56f:1bbb:83d6 with SMTP id 71dfb90a1353d-573a566e5f1mr5070877e0c.10.1777479287147; Wed, 29 Apr 2026 09:14:47 -0700 (PDT) X-Received: by 2002:a05:6122:288c:b0:56f:1bbb:83d6 with SMTP id 71dfb90a1353d-573a566e5f1mr5070740e0c.10.1777479286228; Wed, 29 Apr 2026 09:14:46 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:45 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 v3 04/11] hwmon:: Use non-OF thermal cooling device register function Date: Wed, 29 Apr 2026 18:14:17 +0200 Message-ID: <20260429161430.3802970-5-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX1lNRNPJEeRrz LG1HjJ/RByuNZjMDfvBPKu2cAs4kt+DsBNcIIjQbunwfWfCfRW3lm3t6qM+hpR84Tgg+IH28lPe C3TfyNQ0ZJQyCVVol846ZYSGKlwt4RNH/TLnO2SZAN8AxWHDH114IWhFLmxC5pCXXQmFdobC9ed 4dyLSOBiQwnCFycBm42q+XXz4Ujqw3JoAv0+mvtAO8fD6co9h5D4Lee8jGNrmT1XfdzIyEvvtlj BVkMqzDzKzR1pv6pJvL7L1/VPqEfG0aN0lZt4sTp04yeunbLhPPti4cXAnS++b4ORINJMpodciO ogJcR5ZdIm0MvWDg3TCkZjKXVq2n5CLDxL8apv8XyVw4L44YR9OTdsy6F0US9Cj/v+pn2aQXbrI uP4blf8C2yBiN3/LP2KC2CgIr03wb2jhdNwTJ/oqFoZ5U0ZrMNZAUgDSYWRmm/tN6rWQtMwz8aY HscPW/9TM8uv/9D/kpw== X-Proofpoint-GUID: pL6D5GbU85SePf7wJf9DiPMnXUNaTJ3E X-Proofpoint-ORIG-GUID: pL6D5GbU85SePf7wJf9DiPMnXUNaTJ3E X-Authority-Analysis: v=2.4 cv=CL4amxrD c=1 sm=1 tr=0 ts=69f22e77 cx=c_pps a=1Os3MKEOqt8YzSjcPV0cFA==:117 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=_jlGtV7tAAAA:8 a=ggIEzLyBpZPC2L1Vao8A:9 a=hhpmQAJR8DioWGSBphRh:22 a=nlm17XC03S6CtCLSeiRr: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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 clxscore=1015 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 Tue Jun 16 19:33:09 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 695D7401498 for ; Wed, 29 Apr 2026 16:14:51 +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=1777479293; cv=none; b=XdFzZLwTpGj0Gwo+EQlYv8bkJ8WZ+lDdq3MUbqg6t+RpEb+uCUDweQii3TOWOBUK7T8tpT8QBGevUmuFzhZgSZeX8iD0AOtWRjK52OacU2krCBHRpdQc+vuhy3rct9Rm60ZKjTs6j3PNRBY/NIsu3aPgtP+XDlzJJhuer2mQCfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479293; c=relaxed/simple; bh=8Ds5xtxFWeweGbY4JmIoQElbN9Q78z7GjPvN5NTvYes=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GZe0o8Xjrww0ucVWOxWT2QgC4ScQkZQcs6F3cenKcwn+4GiKbEw6EByWcBqJc28To0bm+AAK/rlRh1WVeFhy9Zzp30m0LYBM4hznSHAr9LQVcEMSCAOu+COJEblQckZVPN/DRd7us+VwgGAR1I/16N2afMjtV+SP4soqAcX4ljY= 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=oytIFMrS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YVhg/b7h; 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="oytIFMrS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YVhg/b7h" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TF2nfR3752416 for ; Wed, 29 Apr 2026 16:14: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=90AIa8NaCz+ zkROO+2dxfNcs3zR8w2E4Z25myBlHOTA=; b=oytIFMrSelK7QEh/l986iwfINGm MA1VkwAQSTaH/BTsYOsIlL8q/l+85jXhcj2RraZNJi6KLNK7DkUiACr937R9zZ6D q+V8SE5O2a0LuxJ/++k7TPJBmQr/FX7uFCukmoHF1Eponp9XSJ+R8DjGHjn38LVx VcD1VGooUX26g40jjPZIkHt0SX7c/9zKf13CE8elfbCxor6iECQNem+U7aGTxaNz B4dvf/fLf1MYnhWR3g6eQZxgtKW2VzKPedU2JdZBVL2I5jD1rg3D5APbXTmJ3Q6q RlpwxHsJBtYx86465WoIB54msZq7eOCunzjjU1MABDiAuoBg9/3RMGPCixw== Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duch1jdpy-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:49 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-950bdef305cso8387743241.0 for ; Wed, 29 Apr 2026 09:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479289; x=1778084089; 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=90AIa8NaCz+zkROO+2dxfNcs3zR8w2E4Z25myBlHOTA=; b=YVhg/b7he+iqAjiYPfmpsbVXQnV1WcD+37hmwPHnHLw9vyw9RfOXTPQ1sc0euleu6r glZxZTwwq/nIK+SprkWeV7msrOISOuCi5UjKvloN3/XN4bVxFNpHAe9sY6GOf8ArRhKA mQ2pNkngHET1SfxCcdZBa97KoFvc23Lh4zjV+OU6Y+5vaBWESo3WnHNnQeBdV1t2aaZG 8HELKYK9dAQfextxtZx4IdCmP+uHy9k7APn/Qm7hLt6BKsa7AhhlJFO8SnEx4OIYMR82 o4O970i/WJlJFVWHbQT/oulhjTiUQKpy72iiuub6Awedl7eOD6EdHhPsnkUnP5QAzP+7 zrNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479289; x=1778084089; 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=90AIa8NaCz+zkROO+2dxfNcs3zR8w2E4Z25myBlHOTA=; b=f3InIVixk4wbt2pCVRMtH316SvfXo69yY9uQcp2mEPnwD4hs1CD+EcdaJkopFDJS0g 4hv1tNaQiPXyJY+DkQzaCja/IgUweHbfNll1HA7JHdHEd9uyna/xWto8HNLJ09fcvGpW /OxJufX5PLMknD7QNXGnchSt8gZpbrZhrln88YcN1NpaBSMoCMh2L6ieGmfw/GXF0qn4 bRxF6xg8RWc1k5oK47Fs26hmoWcdsRVA/Wn1fyvbVFUb6aTeKDkANLsZyy1I2ZlPxtNM LufvVrm88YkR5bSBwWQ7ZsrTH3mQ8Y2bJNdURctZu1ohe524v3/LtiF1I2KBuyq5hO6+ IBlA== X-Forwarded-Encrypted: i=1; AFNElJ/LO9z6jpBlzpUsFQxj9Jk2Lqmmyk+0QLg/Vvg8WB9rn52booj3fR/zsjdzrOjBFFdRm0VSuf2vLFxOfSw=@vger.kernel.org X-Gm-Message-State: AOJu0YyHVUu8AVFiL6QSFGLalP6mYa/D6Q6X27PkRbsmsvRe9i9qGcf8 CLGmtOeUPZCmDPNjmVc8N5T5odFp4Wbp8ZPJCpZ6CijwylyrjMVwqTF2OgMbG89XopZe4vfl31m RvgF6ndYnLBNw3a/mqoiBB0L1f6yPVCpwQc6HZAd7o7Zhj5A3Hu++vDXybweZaZnMR1g= X-Gm-Gg: AeBDiescOALEZ22nFxZ/4getYYl4QU5vv9tnN4dXJVN4fWBoy6fsCVDQkm/fHrQiDJ7 AuiIzELmHn31tWMjBcrZuMFlCT7Ds5iaBzwwgzmTzlfGvc7qRGyG4uf+mwOnGOexColfTn3xYs7 t0G/sDU5Sz7QwgPkoTGEHjEI6zheXYY3Zj8kM3GDZ1AadTlVSHLGHYrujPOFRvNcw6ISclr0y5R 6ef+jKtq3eVqetxIVllTWzo0fp23Wf4HpnN48RzLop/OyGRs32mybjhq6WkgVhY9mxhQzJNwn7S tOEoPgJ4SvEXDApGLGx7ufh9FLcPNUCXJI+1RP+6XXsGKN1ss7tg2Ahi8a9BYJaEYVuto4TUsxa uo2xPFE6HYa1WgNn0Vc/NCgIKkkZ2zMJ8VmsVFkSnsoMn6c9VHax9l+93twqA X-Received: by 2002:a05:6122:3109:b0:56f:6d27:cadc with SMTP id 71dfb90a1353d-573a55d8ed8mr4558038e0c.7.1777479288508; Wed, 29 Apr 2026 09:14:48 -0700 (PDT) X-Received: by 2002:a05:6122:3109:b0:56f:6d27:cadc with SMTP id 71dfb90a1353d-573a55d8ed8mr4557981e0c.7.1777479288067; Wed, 29 Apr 2026 09:14:48 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:47 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 05/11] thermal/core: Put of_node field cooling device structure under Kconfig option Date: Wed, 29 Apr 2026 18:14:18 +0200 Message-ID: <20260429161430.3802970-6-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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=arGCzyZV c=1 sm=1 tr=0 ts=69f22e79 cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=5aU8Z_IAf-MFAndoPNkA:9 a=o1xkdb1NAhiiM49bd1HK:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX+tQfd99XUbIv UXFbE8GXxdhBLolhqHaijfiqYCEOgcKrSiazSfSty3WUe7Kg/VYq7n48VkMJtohzjhFI0kv5XjG SMqkIiEZHfnjaW3/FCA/iEeF4j5/5yHAYEDjA1jJ8/zvpOqUra/v0A/9EU0fPgam6H7Z1a7vDaY oMzVvsJ+r8v0hijYdP6i/KNHN1ewWdvxMYxdNOm3dZXz81dp3NL4qCXjAJJ6fjH5WCFpUDR+BDF JlHV5d+8U8f6mYCmLGWOVAGkNHfXG0ttip8YSpccd0tjya3IF3ES2uMdsjHLF4YXF2tF413XMFO dwJ0RJIoJCroysesCI5D2zq0oMhB3SAUnq0Y+Xhk8MFEpCDriBj1AMRdeBkYieQet6IoLA8oBlq Rkv3fopisY58VSSKrphpd+1CuPkA5im5IwU4qoYOwnDMInj2wZTWX+NYUHMeD4nGMZey0kaskOe +AWxU8936/PvHnKdaVw== X-Proofpoint-GUID: EkUBjVkRZLHNAus8Nzp0VdoZj6rmXqk9 X-Proofpoint-ORIG-GUID: EkUBjVkRZLHNAus8Nzp0VdoZj6rmXqk9 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 adultscore=0 impostorscore=0 spamscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 50b43e328ab9..eff01fba0c81 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 Tue Jun 16 19:33:09 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 7D1214014A5 for ; Wed, 29 Apr 2026 16:14:52 +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=1777479297; cv=none; b=CHPfTa2eyasSWa1BTqs8NbH1vLI1maYHmHylJ38w2sHMEMpgwG5wpzJoIy9x25iShCgVR2sY8Ep22sIqOry2Y+3aQQP9BtPOJGkF85K5z7JalHuYP8Rruv9i+bi2ohxM4iW9UisJpF8tSG/0YXTtRWAvRJNxMc5ftFDWukhhSIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479297; c=relaxed/simple; bh=Ex6Mp6yHP3NfKWI4Djrm33G8n0aBYcaYmApLwhOBJeM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Up7NPRhX9elb+XqBVDsEHnRoV8FvE+eOCFbun21QmAa71O2xQHs6rTP7ck2d/JLDf38W+SH8Lw9dRVt1wZIs9bTASGDlI/lFKXN2ohRlBVNmBFVhIMd3d1UqEAdWVRFKPIEGIadDS2nWqI9IPNmTTgHX8CKiytpzkDcj/SrL+lY= 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=iCEQz41S; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bUOEx5RJ; 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="iCEQz41S"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bUOEx5RJ" 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 63TFPwuJ2094252 for ; Wed, 29 Apr 2026 16:14:51 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=E3jiCPQeEhU GxNHVRP3aV2Dn9BaGTadLWJf5AW9mXkk=; b=iCEQz41SuHPbf+wrx8gm8zZ3rsM RjH2VXgjy/3nwYBmYsNy5JpoSBcr3lgALB9Nu/U520RTA2eb9JYKaLX1tjpCn7TL O1C0LW2mXsD+ph5eMh85ahC3SbNHbZzEwLfvBhMmuaEMxCbI1U+k5BS2d3+N7+SO ULBn+6aGZqygTOV0yGWaJ+sIDPnOUkFe/WRI7HZ5vsUn6o4auKAiY9+K8n32kfZ0 iO15qowVXk8r76iJomqo8tUoVlWy7ko2YJfGk2BB7xSMogJqGF7bDc4/1XJG3g9g KJQwcpGm9G2YMkgjREt/E2XHWmLP27LWjwSQFeAONACIQdaMH/8reuIuh7A== Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dudh3t657-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:51 +0000 (GMT) Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-573b509b39fso971150e0c.2 for ; Wed, 29 Apr 2026 09:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479291; x=1778084091; 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=E3jiCPQeEhUGxNHVRP3aV2Dn9BaGTadLWJf5AW9mXkk=; b=bUOEx5RJfDnK15eLSdd0tGVPkVLX2UWjLFhyZs8B7WSd4eQX9Oi01W31pv/COenQIH mEDSDBVUa5acxbkQOxsS3nKuZqnJ+pexkoeFJajCTTPOJSyBSCMjgwpiMNNI2zzE+BHS iR2t4OOqGgqYaiAL4iL8fskX62JlxCOcpOTlnR8JMOcmCJjgRrpgrZFva56maKF3o3xD t8b6+lwrtBAajqX1bWyiUfYGZ/EWwBwlKrxKl7jYkgpj7IKeoM8VogZPUuj7Era0hwKc gc/iq52PgIbFnV/42RhVRSHYDQ5Iwd+0uIGoem8MRP9Oc1hz14D6GY/WB1OmhvyL2d1E jg+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479291; x=1778084091; 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=E3jiCPQeEhUGxNHVRP3aV2Dn9BaGTadLWJf5AW9mXkk=; b=sQMduuJ8LbrQHQZM3KmAVGCvuHU+f+RTii5fh1AhwUS2UDzJYG9mpM58GiQvKPepJX dzOW5kbv2bu+kzfLoi5ymMnGqfGDC1OxD6qMgK9zC1Z7pdSBgW9Z0U37MihJLoMtLEIO PNcKzrIeGlXERrZRnBe5PSjdJAIKEANid7dbDygMoV46WskeACYRW129wxpdx0daDtJI z2w1hnd5RxCuwGz6T9XyimxnKMRsekjBjReSVd9+wWSxFAsrTRzgXyOMeyIpLN3DfQis xqhM9UCC0dtEUCtSP3Nmj1Fe+ycJVoZQHkYU7TVUpSZUv3KW88D1KqMJ1T7nHhIkFND6 PwLA== X-Forwarded-Encrypted: i=1; AFNElJ+MnWIaltfaXODPcb8tkwLbVcPJsEkrbOba0HDSpRhoOyEsZtXD5vU0r1FURN1hfjMLxkl3abWoP0a3a8g=@vger.kernel.org X-Gm-Message-State: AOJu0YxWs60NqKSnxeOUKHuEuu8RU2pk5sMBhjEYnaAfNEj/blnqsUgZ QGk8o2GjZCSmBVbSM7jkAO0/3q7uOEvrh/wUyIJJSf0ovo7H3aQYpJqLOwTJGA2GA/UxQZ3cqS6 xDestxyYV8IO2ro+W7eRC3DLehTEaCsV2rmJgUO0EbXdoQRr4HmwsDpACYmnZQW2iNBQ= X-Gm-Gg: AeBDievR9mSxK7eSa6i9M/TaFmi0vRBp9QhUl8p95X4lHRP3oNk37Tqd5xgow+DD1No seh1/hn0wK0ok38swRAgzJ6XMZU+/ofL4hNLHuguFLVI0X1AFVItsYte4bVZ5ryo1W+J6F/dDrD F/m3sdYTWe+Z2OPPjm26xy1fhgSOoU/4MnchmUnclGXLykIFJrbWyldWkxqHqpa/WGC401FpZeO Sa0jNVwu0HZDUwILwTnxSsXJHr8hS6+jHQ2t6Ad/3nWJjuDJF1SKPgRhNNEgiipmCIjB6hm7wPa ORPxxoKJjONUDLErCPSzEJiqorA5p5CMFFVYceAxD1W4vPPgxEF+JREB22eccvjdWMTqdQo+Q/H v3JJcVkqGldEwNVi6U6qSMmB3VBXA/DsQSDBqnluaxgAraMkpOO9fqC3icaXP X-Received: by 2002:a05:6122:83c3:b0:56e:f262:9113 with SMTP id 71dfb90a1353d-573a574bd4emr4901030e0c.14.1777479290523; Wed, 29 Apr 2026 09:14:50 -0700 (PDT) X-Received: by 2002:a05:6122:83c3:b0:56e:f262:9113 with SMTP id 71dfb90a1353d-573a574bd4emr4900974e0c.14.1777479290066; Wed, 29 Apr 2026 09:14:50 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:49 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 06/11] thermal/of: Move OF code where it belongs to Date: Wed, 29 Apr 2026 18:14:19 +0200 Message-ID: <20260429161430.3802970-7-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: dCgvDB_KzHLuAh3fH44P8Y6w8we8iPeH X-Authority-Analysis: v=2.4 cv=A4dc+aWG c=1 sm=1 tr=0 ts=69f22e7b cx=c_pps a=1Os3MKEOqt8YzSjcPV0cFA==: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=jLM6qsj88INzSaGZquIA:9 a=hhpmQAJR8DioWGSBphRh:22 X-Proofpoint-ORIG-GUID: dCgvDB_KzHLuAh3fH44P8Y6w8we8iPeH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX/NaPbLYm3mC0 9jEcfDMqvD4WJKLsPe8MCc1dNpfkLBVI7R0IhjtRdAicDbEsuvp47+kzEwN3DB4l7SF8DqFqTeo 37fzbMufvV1ZDhZ2hTh5WbtLP4lEKdZ0XEa9LlkeLClsd/rVctODUx3AWQBmBxTGYwDSM42EZiQ a2SFTGDopz6WPsw5LbuLD922vreDASsaKT3yv1iuzUory2KehsF0ymqv2kbfRReRxWQxm/x/MUY Y9VtRIuiTPhvhh1q4y016rDuZwH2Hc9haSqc3FpSJ0HKduva6IwW4asiqiGHj1Rj8s95id/C72G EB1Xoz4ophnsT7xeALBhHMMIIqOLmM9mu4cJpKJISBJlkjYifR9PGVeEVYIKiEpe+p8ZSyl7T40 tz6I0Y+E2jASH8a9nioji+JYClN5c+UfL7WkQynbQCyngHY991l2f1P1+ZPybDcAktCI0wLq25f TLO4PCRUCRDMpwqyPnw== 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 78 +------------------------------- drivers/thermal/thermal_core.h | 6 +++ drivers/thermal/thermal_of.c | 83 ++++++++++++++++++++++++++++++++++ include/linux/thermal.h | 48 ++++++++++++-------- 4 files changed, 118 insertions(+), 97 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 7867e6bc0a6c..f779fd393323 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1040,7 +1040,7 @@ static void thermal_cooling_device_init_complete(stru= ct thermal_cooling_device * thermal_zone_cdev_bind(tz, cdev); } =20 -static struct thermal_cooling_device * +struct thermal_cooling_device * __thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops, void (*initcb)(struct thermal_cooling_device *, @@ -1150,44 +1150,6 @@ thermal_cooling_device_register(const char *type, vo= id *devdata, } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); =20 -static void thermal_of_cooling_device_init(struct thermal_cooling_device *= cdev, void *data) -{ - struct device_node *np =3D data; - - cdev->np =3D np; -} - -/** - * 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) -{ - struct thermal_cooling_device *cdev; - - cdev =3D __thermal_cooling_device_register(type, devdata, ops, - thermal_of_cooling_device_init, np); - if (IS_ERR(cdev)) - return cdev; - - return cdev; -} -EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); - static void thermal_cooling_device_release(void *data) { struct thermal_cooling_device *cdev =3D data; @@ -1230,44 +1192,6 @@ devm_thermal_cooling_device_register(struct device *= dev, } EXPORT_SYMBOL_GPL(devm_thermal_cooling_device_register); =20 -/** - * 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 *cdev; - int ret; - - cdev =3D thermal_of_cooling_device_register(np, type, devdata, ops); - if (IS_ERR(cdev)) - return cdev; - - ret =3D devm_add_action_or_reset(dev, thermal_cooling_device_release, cde= v); - if (ret) - return ERR_PTR(ret); - - return cdev; -} -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..6935b09b9978 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -269,6 +269,12 @@ 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(const char *type, void *devdata, + const struct thermal_cooling_device_ops *ops, + void (*initcb)(struct thermal_cooling_device *, + void *), void *data); + /* 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..ba6f246ddef0 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -510,3 +510,86 @@ 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); + +static void thermal_of_cooling_device_init(struct thermal_cooling_device *= cdev, void *data) +{ + struct device_node *np =3D data; + + cdev->np =3D np; +} + +/** + * 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) +{ + struct thermal_cooling_device *cdev; + + cdev =3D __thermal_cooling_device_register(type, devdata, ops, + thermal_of_cooling_device_init, np); + if (IS_ERR(cdev)) + return cdev; + + return cdev; +} +EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); + +static void thermal_of_cooling_device_release(void *data) +{ + struct thermal_cooling_device *cdev =3D data; + + thermal_cooling_device_unregister(cdev); +} + +/** + * 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 *cdev; + int ret; + + cdev =3D thermal_of_cooling_device_register(np, type, devdata, ops); + if (IS_ERR(cdev)) + return cdev; + + ret =3D devm_add_action_or_reset(dev, thermal_of_cooling_device_release, = cdev); + if (ret) + return ERR_PTR(ret); + + return cdev; +} +EXPORT_SYMBOL_GPL(devm_thermal_of_cooling_device_register); diff --git a/include/linux/thermal.h b/include/linux/thermal.h index eff01fba0c81..f207ca6b63ae 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -200,6 +200,15 @@ 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 *typ= e, void *devdata, + 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 @@ -213,6 +222,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, @@ -254,18 +280,11 @@ void thermal_zone_device_update(struct thermal_zone_d= evice *, =20 struct thermal_cooling_device *thermal_cooling_device_register(const char = *, void *, const struct thermal_cooling_device_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); =20 -struct thermal_cooling_device * -thermal_of_cooling_device_register(struct device_node *np, const char *typ= e, - void *devdata, 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); 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= ); @@ -319,18 +338,7 @@ devm_thermal_cooling_device_register(struct device *de= v, const char *type, } =20 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); -} + static inline void thermal_cooling_device_unregister( struct thermal_cooling_device *cdev) { } --=20 2.43.0 From nobody Tue Jun 16 19:33:09 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 4416B3FE656 for ; Wed, 29 Apr 2026 16:14:56 +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=1777479302; cv=none; b=uqRYOwOQdE5mXIeWHK7GxjvYSg2HFiDkqF5nuhK3Ry3CKjUtzia4L01Ij2SG6cf+qJCR9mdOOhVplgbEjjfiil9DnigtjiXU/RfH3k714/QPFMeCQEaccBrrzWOQjK9+hb9YHWSyTg6oF5WTjdv8sX5nQdkpryKE4c54ufH8MrM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479302; c=relaxed/simple; bh=nTw8RjWFKITdcvHReTcq1FHnN43/FCA/K0PRTQQ9P6E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VOOHknxxfDPjPQJIbDLe4/c55K4YHg/T2IhQ5kKjQOegixCTvuOrb5/ho7EMX5kgisnfpl7cd1lL3hehvJDz+E6ufAjkSdolL3eyvIlZeS/pBaJx+gLUeOtCvHYC7nBnDVF7BtYpJShCFZCrpwZuBqW0KEaKoh6Bn2/jQFDmB9M= 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=FvQWoVWE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=j+BQYLbu; 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="FvQWoVWE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="j+BQYLbu" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TF2Whq3752640 for ; Wed, 29 Apr 2026 16:14:55 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=5X6EWdy6gq/ TxQgL9gfFBe5KbMSDagX2IixukijnMmo=; b=FvQWoVWEDz2znEo6zPvKxw1Of6i DWoo+JJ5TZkiMfinl++SZNC3zQLl+mo+AqVxWIxWC0kSgag+FNyvGb5LJouVWHw0 HDA77gl6FjFw4To0KVQjXyfTw+Q0H4PQ0Cr/auVEvSG9unlus4cx4WZWeKEOS0jn /gQh9IAjRY6O0OZPSzm+iYm8wIyl/Qkk4qWIqxMjRBPMMbCS3od5IXAo+SbFGpKK VjsFn8nCgr9ni1QGcxUNAAHxvpjYfziwGCoYnpr22XSY3aOpFMxtQPcBM8YiVc0a dZ5XRI0oyvOGXGgCktxLjo05qGlropswOtU/Vim21Sjm8eLB6QL2dg+HcAQ== Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duch1jdqv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:54 +0000 (GMT) Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-56eeff9a41bso23332010e0c.0 for ; Wed, 29 Apr 2026 09:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479294; x=1778084094; 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=5X6EWdy6gq/TxQgL9gfFBe5KbMSDagX2IixukijnMmo=; b=j+BQYLbu6K3lZO4kj100/fZey3pYDWENgAlv8oLFGiuLbqnNvCqglY4m57E/ghNkay McL6LR4o4o0vAFuWCdsa5VALy4+Q5MwnejN/zydGlPeejh0wP1m8bz8/vUqnq+gPz6hE Lcz9j4vFDAQOrvfs0ftlscApsCQuUqLQvj8FSlFYqBhhbpvrY62S6ePNM+S/uuH+KN/W JET9d4SfzsiKlWcBfQwQH/BBKe0dvUlhkERG6TOM0w4wR3OGUGuHeNlXoSlHoZY+qLmh ZmJasPRn4c9rc7nOQsQpgAGvajJjgBrAVYfxR6eKwvHN2GmkANOZgBhg/we1fBMt5IMs HO6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479294; x=1778084094; 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=5X6EWdy6gq/TxQgL9gfFBe5KbMSDagX2IixukijnMmo=; b=diYIK1cOOgvyvTIR+Cj2GkxVpLh9Da12r1I8bgb8qlYf96dSx6fuNP+e75WoFM9WmL lJgUUQcIbLgCFCyxjPKd9ygZEfznrurrWFXuQP2sn/RBS+06BSsIb6/EXFL19XJ8rX2I rKWx++eoxHWJWpCzKjeSVnwTWjmni1R1SXZ1njiRGjrlBrWwbFjNVhWGlm7SwsbuP1do U6owavlnkoWmfKJBhOE2YE1gLCZLk8uiaj1pGVVaSvUa/QrgxZk45/k5NcZjM/9TEqHy wKqj/CRn2PoU7np63POtxQQSeWoG+Lwv1fFmdeTKcyNZiif5qgCnZ8/2ybYUoCIwk5vH iu1A== X-Forwarded-Encrypted: i=1; AFNElJ87LveMlPbYG4Ii7gooJL5pEUekNT8u5B6aVcdKtqRu5zpBdOuN4MjyigfJ9v6iPces6BUvc9zrXe1VHI0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywwggr0Sj9PmbPpCBiRsA64+yXzRoPOphNM5tKtRuLPHxt+g0hJ aKPpy9X+sTQGH1E2HLiIB4jPLNTrykTSfkkpi5UVSwpfNflTql00DrRup7nOOAE5kYYkqEbChXP V0Sduzl4NNfbwBilVVtPZQnjEHJi1bvhJpHvhj5p865K3woG15DffYRzyt7OVWoliRIU= X-Gm-Gg: AeBDieuSbk22AG8R8vPsiHWBBTrjeW3TI0JDFezNMiowo43AN9Xx57Y9zXpz8M9JGXj +ZPaKMfevrkbR/6Okzny7JDl2ZLE5mpoMM9dt+mjz+ZG0t1ujkIZsd5eTeNdLxt9TE0JIpSVYkU CtF7SjhRse/RPSRV3DRr/6RzSBFmRNwZOnPZnpuXkhFwo22+6qpOtYD3xIRpbEfGjTKqFkheoi4 4EGoZJrf+cIHZ8PxW00A8ht0WSXgZ1Mi4YGeWhfcPzfmautuYeJ+Kd2C7wWLSitov+cDlgJEcgH zmULrCg/srpPgojnK5uzMN86uOTJ2AymsjrqOsZ5Mkzu5/CJaUvMuhsnBBr+7554kAhST89dPIN NjcDEQt7pBZwMW36dnryDXb38txeOPXAOFrObuKE/vj2e3L7LBS781GvtouoT X-Received: by 2002:a05:6122:d91:b0:56b:7023:1393 with SMTP id 71dfb90a1353d-573b35fc098mr2556164e0c.11.1777479293866; Wed, 29 Apr 2026 09:14:53 -0700 (PDT) X-Received: by 2002:a05:6122:d91:b0:56b:7023:1393 with SMTP id 71dfb90a1353d-573b35fc098mr2556050e0c.11.1777479293244; Wed, 29 Apr 2026 09:14:53 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:52 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Ingo Molnar , Thomas Gleixner , "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 v3 07/11] thermal/of: Rename the devm_thermal_of_cooling_device_register() function Date: Wed, 29 Apr 2026 18:14:20 +0200 Message-ID: <20260429161430.3802970-8-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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=arGCzyZV c=1 sm=1 tr=0 ts=69f22e7e cx=c_pps a=1Os3MKEOqt8YzSjcPV0cFA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=YYchOvpREA9nlnY3_CYA:9 a=hhpmQAJR8DioWGSBphRh:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfXzRqjoG2fl1SA tfh6MyMhdVx6XdweKeKhrxCRubGA0LWJd4BUp+2Y7PwB0InBlM95wcNpjfnz/YijnFuMLBynCuY kvs6FrT4KUjRmFcE7e7jwKBj3xMgojNpg+smwT8NjnLAMKdoe27IphQle1Sne9+zBe4Ev+UPYYo HFBhmb390zN1yvvQDBhggJ1nsq280yWaho6mlUbFF8hivE7gQXNMfemTDM6UVq1CTGigU1e/dTf ALqftV4b8tbQoF0LnLIs35jmrVCrjyo6VF06Gg7QCnwqmOa3M4E6T2l0Jb7QTl8ey0KgSQ/kCLp nEwpWoAeTzKc9ElwHJOOAjb8arxgZCy7TXSGEo5VfEzyY6C/0XkIRLvcOr8XhB3r2/uiVXnMOLZ CCsYFhu72A88piw679a6nlw+bAzOexyU2usn8FVlO4ARgxrsntUAbjUOhkkCN8xardolzFHMi1j ihuRLsU+qYFPLKrAl3A== X-Proofpoint-GUID: 6s3clqgNllZfaho0O08yAMtMqChf2mFA X-Proofpoint-ORIG-GUID: 6s3clqgNllZfaho0O08yAMtMqChf2mFA 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 adultscore=0 impostorscore=0 spamscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 | 15 +++++++++------ include/linux/thermal.h | 16 ++++++++-------- 15 files changed, 54 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 6a56638c98f1..d8e988a0d43e 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -1707,9 +1707,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 ba6f246ddef0..cf60ac64db54 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -557,7 +557,7 @@ static void thermal_of_cooling_device_release(void *dat= a) } =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. @@ -570,14 +570,17 @@ static void thermal_of_cooling_device_release(void *d= ata) * 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. * + * This function should be used when a cooling controller has child + * nodes which are referenced in the thermal zone cooling map. + * * 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) +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 *cdev; int ret; @@ -592,4 +595,4 @@ devm_thermal_of_cooling_device_register(struct device *= dev, =20 return cdev; } -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 f207ca6b63ae..e39bec84b2b6 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -205,10 +205,10 @@ thermal_of_cooling_device_register(struct device_node= *np, const char *type, voi 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 @@ -232,10 +232,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 Tue Jun 16 19:33:09 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 6BDCB40242F for ; Wed, 29 Apr 2026 16:14: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=1777479308; cv=none; b=igmzM9pAdIgHBpE+Jl3OrxaNpH4k+SqdZ3yiSghoyf9T0fyRtFqVooNiT/cVzffcic20a5JkzysFRil7y3zdvIO8RjRYMB38vizJRUUYTO98EqoHTQj4pgPj3/mxaWRvQ8775gRqOVjH4fhOezPJPGyPKQMZnOJQCrNysm8dtQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479308; c=relaxed/simple; bh=+DRR6FZB+Ld5aamPPfnWIhChpMSGE/UzOJvDixuYT8c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BfQ3eJ0crzfbJazIZETBF6zu8RP/W9uig5UQHwDkKLhllH6AHgLs1ga637HwpwF7RNRC1SS4Z+DU9RSF65PBcCjfFGq9Wixjk+ca1y+FVUc9XwxT8t6zKaqwrh0+/4WrfwUBskOSioI/bmR3rf1coYXMegfrA5c2RNO+BZOvCNI= 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=adwaPxQN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TIXy+KVR; 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="adwaPxQN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TIXy+KVR" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TFLvCB3752474 for ; Wed, 29 Apr 2026 16:14: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=QlIuh8BM0Sa SyTeAREDnPHaWMXvZjHEGYrSurFk/U6c=; b=adwaPxQN1ZFLAoj5evhUxLj8Dub gQzwmrMQs6MKYZhkYAg85k5YXLDNXCttNlXn+hKBLMJdI9GgMACVPujLb+6/1Izp UW0vdfGT5a5liZ9LTWnwFm5rbs7wmB3j7jv3Uhvb3llXqB0CSLXuP4D9Q19ZsoxA GDC8cksxVQv5T/jW04qUiJKBV9/WU0CLRqI2uko3JP1CsnDtRynkT95VczHZ54wr mtnQXkq4PowTF1OVbQkCE3U5xpZPhIVPidMLdA2eAVDzTUWI1W4uh4xEf8TEfce1 gB47Dua0eYb6FNxWDUI/DhbNawh24OfStpfOCdoxge/dwBEqFyuAvXKLoAw== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duch1jdr8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:56 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-56eeff9a2e3so22070509e0c.3 for ; Wed, 29 Apr 2026 09:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479296; x=1778084096; 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=QlIuh8BM0SaSyTeAREDnPHaWMXvZjHEGYrSurFk/U6c=; b=TIXy+KVRjGLiV7RHrZxDALkPPaHMCGYkGAKnxwLYmObOKMCEu7JjTLf3HtYUV6YI4l Vff8qYz3W4pBL2J4sQ65sNpz4Jg5yTZ2x3QpIROR5EnD5iODk9MGpnh7hZxtLSHOXN0a DibBHZyGYDDY40BetRosIEmpg2Ylto7RhVW5Jg9GxU4DWlgktTvWsj5O9Pw/fqrbYERJ ZiZddlKXvVlTvWLRuPjGo+Mq3QMTKe63h+ShMiIeMbKTFKGVLuL+gBjLUz5KFdTZ1vKQ oJyVOeKxyfYviKmMefsTY7mXAXFwqGAZRWWPdPjoDxqGGI9GT6XXPD9C6RuneRqJWder J5Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479296; x=1778084096; 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=QlIuh8BM0SaSyTeAREDnPHaWMXvZjHEGYrSurFk/U6c=; b=bk7YIriNuwpR1IpKCVXFjy1ZmQA+4Gcu2j7FPZ00Dr6FG6qO5Vvspt6HQ3P1juidLH UxKngq4N/imgrXgUbF/ThAdWjKo8/4E+uJ/iEgV1uDmFIV7IrKwuwzILMHZCPJnMZfFe tHn8vpZjvMe8dmWOhT+Hfjhf9BszRzEFB5GiN+qzwsirNf/TKMOVfjihcAyMUe93/9VH 0xj7KGGK2BHoxpmOxGdwfsRRMsyE0jKugdUS1GJYaXiWFU+xttfmg4fcCUMUZQnZhft5 6JNJw5ogu5pZheMA9lnqVnua+o3Qk5nBAIPML5OcMMwDx20k7sb0uaPiJ4szqDKb64Oc uS5Q== X-Forwarded-Encrypted: i=1; AFNElJ83NYhSFwpbrnZB5VT4HoodEPW7GDxUuYFP6qs1EsvzA/NyC1vZZ5+gAvaIMfqkATGFVRhgIb3r6Phf67Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4UdFTD7nEBPzk0SM1Hv8zljOu1dZA3xxOurRmhPjzOIVMMJlx FOnsPauVIjEDsFksx5HX/L17xpzlgEFLdO6aXSQURySXtq2Qer+QznDSVp8q+FwSQrXAbnyq7lO vAbmzRTL4F7+P14yv2DVj9U3fsxMofOIZZtsMH2fLH5U3gjZazGWPQyMmqo7fTkdZ2lU= X-Gm-Gg: AeBDievEZHMKcSu/UpGRFXMVVn5Gw3Ro5SjxEjSHfjGvqhrC7hn0kMTU8nZaPJvfGdA Y6WCUCxXZW9uHHtHClYlpDDtLPEkk9ZbXDxbKvNJhZALkNXGeV2GdYo02DFRzFKfTlUUaT3ksAu qv8Ucfsje51iyV2CXhWLgZHV1R0N9lifuE28sTuYL8GqRAillxO1jCBt3/3sJPnwWZuOCvgfAMn ew78t3okRW2YvRWYBuQFRTNk/S1aOPYaOkXXR05qhlf+Aju51hn3zDFxckCymkotF3Ug6IY3/gL fsXLxFQNQAiwl5H9MmJmL+ZbrNqxyxbFSY5B3FJzlmg5aVBgaADq4FTXtzkSUrUQ3sIf6KoMrVK RJs6/6MIpQZyHSi2wN001kHFDt+YNmDpobh30sVxbID8WICVuIETNHtTFwirA X-Received: by 2002:a05:6122:24c:b0:56f:7c7e:f33a with SMTP id 71dfb90a1353d-573a52eea5dmr5244084e0c.0.1777479295805; Wed, 29 Apr 2026 09:14:55 -0700 (PDT) X-Received: by 2002:a05:6122:24c:b0:56f:7c7e:f33a with SMTP id 71dfb90a1353d-573a52eea5dmr5244024e0c.0.1777479295316; Wed, 29 Apr 2026 09:14:55 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:54 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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, 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 v3 08/11] thermal/of: Introduce cooling device of_index Date: Wed, 29 Apr 2026 18:14:21 +0200 Message-ID: <20260429161430.3802970-9-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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=arGCzyZV c=1 sm=1 tr=0 ts=69f22e80 cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=kkni0TwwaAke5k-tc94A:9 a=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX9ddfm5eZgcS7 t12x9CPDxX7dhJ1tOKV32vqoYMDIMUvg0zDWwO8qvwZWv8fydr1AIdmUypMQSjNnnyKhEU6kL8c fwiGNSpLq3PlgQN6gZDJUg9bE+sDXEyY8EEkWKwSJ9tlV+J0KrgANmsBI+8wKo/vt/FUBcuilQQ 1hG437H+xOrH10Arlh5QFEwRg+cJ/tMp0eqYnUHs+mgkd8ODvuP9u6e5dM2SVct86/FiIzqp2PF rTJEWhfMcNZPC0+A2dIpe087qRLHn76xofzOx+MNSjUm+r4B+kqTCcj2l09NffHFxo+GUnLlY1/ nKH2gdzUA4OJJneAnN7ikLiA/c3QsSSo+YQ9UUbDrXatjpegMDY2rFtTTI2zOGgjYbJGFxB1C/4 5L0pYwfI/0kx9W5GJMpj3e6ewlGOjvCwjLE/9sGtwLqhvTgQwTf7CH8Q/h6PPoQ7+YHpj8BacpI FWPxyOSiKeCMczyaNhg== X-Proofpoint-GUID: IdY9COTYblgzz5HlKZiWPxsnwpieoNcb X-Proofpoint-ORIG-GUID: IdY9COTYblgzz5HlKZiWPxsnwpieoNcb 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 adultscore=0 impostorscore=0 spamscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 | 5 +++-- drivers/thermal/cpufreq_cooling.c | 2 +- drivers/thermal/cpuidle_cooling.c | 2 +- drivers/thermal/devfreq_cooling.c | 2 +- drivers/thermal/thermal_of.c | 21 ++++++++++++++++----- include/linux/thermal.h | 6 ++++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnavi= v/etnaviv_gpu.c index a891d4f1f843..552631c3554a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1791,8 +1791,9 @@ 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, - (char *)dev_name(dev), gpu, &cooling_ops); + gpu->cooling =3D thermal_of_cooling_device_register(dev->of_node, 0, + 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 cf60ac64db54..b38623f6b89f 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -511,16 +511,23 @@ void devm_thermal_of_zone_unregister(struct device *d= ev, struct thermal_zone_dev } EXPORT_SYMBOL_GPL(devm_thermal_of_zone_unregister); =20 +struct thermal_of_cdev_init { + struct device_node *np; + int of_index; +}; + static void thermal_of_cooling_device_init(struct thermal_cooling_device *= cdev, void *data) { - struct device_node *np =3D data; + struct thermal_of_cdev_init *of_cdev =3D data; =20 - cdev->np =3D np; + cdev->np =3D of_cdev->np; + cdev->of_index =3D of_cdev->of_index; } =20 /** * 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. @@ -534,14 +541,18 @@ static void thermal_of_cooling_device_init(struct the= rmal_cooling_device *cdev, * 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) { struct thermal_cooling_device *cdev; + struct thermal_of_cdev_init of_cdev =3D { + .np =3D np, + .of_index =3D of_index, + }; =20 cdev =3D __thermal_cooling_device_register(type, devdata, ops, - thermal_of_cooling_device_init, np); + thermal_of_cooling_device_init, &of_cdev); if (IS_ERR(cdev)) return cdev; =20 @@ -585,7 +596,7 @@ devm_thermal_of_child_cooling_device_register(struct de= vice *dev, struct thermal_cooling_device *cdev; int ret; =20 - cdev =3D thermal_of_cooling_device_register(np, type, devdata, ops); + cdev =3D thermal_of_cooling_device_register(np, 0, type, devdata, ops); if (IS_ERR(cdev)) return cdev; =20 diff --git a/include/linux/thermal.h b/include/linux/thermal.h index e39bec84b2b6..26e33c0236c4 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,8 @@ 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, const char *typ= e, void *devdata, +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 * @@ -224,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 Tue Jun 16 19:33:09 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 90ECE3815E8 for ; Wed, 29 Apr 2026 16:15: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=1777479305; cv=none; b=JqAZTLvygN6rw96dGIIhMW7S4lmJsoVNHNMNuSWvbso+PU7/HP5ZVEGu1mex3KwDrIQQ0Pd5xMHEZ24sFHruirA6qLkkABrc4BIdPNP6/Wn9WJDsv1YF3PECdKH6WSAYWnEXciTXgpoG5pj/iajh8X9XSYVTvmjZzWaS8/ljVJw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479305; c=relaxed/simple; bh=W/DA7KZaSHERCdjZ7882n6PYIAmCOm8xM23/+2wKGcM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=joN70/P0E3Pow9FDOMVQ+DmVdscLG58qhl9D7dIb4Lk4qkRx7scGkM/MBIj7Grs4GliAnR0pmyOQQkCAo50WJYb/NMAN+EGBjlNMCBkkGlZWvxZrkBuEbZA5r8u3jd47qt+O8ruKwTsDLrgnK0N+LvQiKW+WOGESlD6m79Ge87c= 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=foDga1mj; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Gm1v7X5b; 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="foDga1mj"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Gm1v7X5b" 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 63TFXCni2094157 for ; Wed, 29 Apr 2026 16:14:58 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=PdrQctDCz1u Wf9yrg/YenTJPvqTEqEJU5WiItR+z2bc=; b=foDga1mjOzOQkMlobyazC6MANnO Pay10GstU7ntOvRj0gCfl0TQ4ligxn7IYEVZftyfFGH+oDcSu5RgkJPd3oct3DvF ZYWlOARKL3Vfc4dBNjK+/j7xLVKhQmyBw1ZZyJIpxGU0aaOH7rz+HDydlVzRp/2U 7yr3ZNhQT0XcS/LKe5NsO9XhePt/9bXgSSEpWB8VxXV0AWT/tPzu45mqlXPatrv0 PlitsHUbfUH40rO3D2SBuGczj+Tv33cUd/7NhP1bTmmN8sjZX8qFDBVJlOakFP5d UVvU+/xgJPb038GdVTooJZN02BciqBHjAgzNIFMOiztwcVjoX+wutjGarQQ== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dudh3t66e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:14:58 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-56d9f191b6eso21902944e0c.2 for ; Wed, 29 Apr 2026 09:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479298; x=1778084098; 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=PdrQctDCz1uWf9yrg/YenTJPvqTEqEJU5WiItR+z2bc=; b=Gm1v7X5b+I5ZQ8tgaMqtOivIilIwFcrBn296LYLvXnh2Rgw/NQy2tRd0XVywxdAC1e gm3ynmL2Aw9Hnfsg1svQD6JTmigB0vCxjtOcYWIG5VHKoe6Ph/jDhQfpHAefEavcsORc FX+y0OozZ+MxtOnPvN0weRcK7Nz4RBYKqn9zJu/SZXFgUopAAeuBj4ozB0EUU4RotrbV T/Y9VK89l7Gs86kvYz7c694d5GJjifFk4X9zKmjO2Z6iIc0kl7iX0RN6efQLZXu0Zmqk h+eKAd5xNs295z6K43CbWG2PvUyEMdPB2FbO2z9f7hykYaafA+B6doQt0dFYtLyTvZox lvTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479298; x=1778084098; 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=PdrQctDCz1uWf9yrg/YenTJPvqTEqEJU5WiItR+z2bc=; b=Idp/M1sI7WrUSzjbZCUoHHVRlV8HF2/mDAiqM4RYtnAUXW+GyFTtUYQhR9JceyTp6b yHz4vcSEJ6NxVKU3KRrE2FP30qonILy4B+EbDElCeZ+LRhMGDH84h3nmDLnULUREUqRy BFT0G4bpxKclNafuwgPyCcJhtf4UeIZ7TfdqjvNMhZ8ScRJ8RfxTFC4iJYQ6XYsAjp8i fKUuKbfAUv4O4hnO04fAxaN+gliTdhZis+4sXingvf0AA+UKQN4kY/Pahrgigec3PH/P WKMpRgsCTG0/+UlpdWv379BWaekUoIcjsr0xx4HXS6+i/AKn1/gdnxGqNPiMY2RxHsMb znqg== X-Forwarded-Encrypted: i=1; AFNElJ+mlKdE/pQg9a12IoXZA2jO/FDZmfY/+Ybs+mrSoksfFFYq+wgQePptIXgHJtH5RrFsHWu4fXWB5bUeRkE=@vger.kernel.org X-Gm-Message-State: AOJu0YwhSnxSSzw+hUEyUSUljO4JnsHQU2Tgxv+MPgaKfnrpIwqEUvzR qfo5FySRDCzlbMnosvJN4Agc+8mHa/OODigVHIi0m/g1FsiiQ9y7cQwYJ6GK7348/f8vItEPnxA DP34umH9T+rjJ1jMesvRz8UDOGL1e4mScJeLb65iMnW/I55jdPPBiTLUp0PsFjhlyvaU= X-Gm-Gg: AeBDieuGcRNZj74DebjpHy9snbLnGHIQUQJcBixmROrBGN64osDHweszSEmNy/iasXA HuoO1h1zPGLl3ykC5nkn2g/nFYkGmwTz6t3Yscr8NdlQHHHG0jaYWdPxm8wuhLKfb+5piUG7bXB FoYnshCDJ5zSz21QPyYOc1Nr/C5vMzRvUVYdPF0UHrM5pVI8nsZTz47tOx0kQHMNPM+0JQEldC6 efGsYUV2lClvNJP1qd52dHp14qATLbwCGRoLw+9dI1fKzpy2jnZai5OEhLUGkyDQFNE2CUpRq9m BYj3piYj+e1LF9u3FSqXsNSJJ10r8tU2pxkCA7cBhD3A25PlVG1V1MLM/a8283A/irLA+zUdCao WVn7mX4Dg4L/s65gKGbGAXhgG1ZQMIw/mqDqn9aXIGN05kCI0wn2CmaHy2XoG X-Received: by 2002:a05:6122:e202:b0:56f:317a:65d9 with SMTP id 71dfb90a1353d-573b34b118cmr2667143e0c.1.1777479297614; Wed, 29 Apr 2026 09:14:57 -0700 (PDT) X-Received: by 2002:a05:6122:e202:b0:56f:317a:65d9 with SMTP id 71dfb90a1353d-573b34b118cmr2667099e0c.1.1777479297210; Wed, 29 Apr 2026 09:14:57 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:56 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 09/11] thermal/of: Pass the of_index and add a function to register with an index Date: Wed, 29 Apr 2026 18:14:22 +0200 Message-ID: <20260429161430.3802970-10-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: Vp0WYd0fwaS09HZq7d-5QERCUkIKDxAc X-Authority-Analysis: v=2.4 cv=A4dc+aWG c=1 sm=1 tr=0 ts=69f22e82 cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==:117 a=V4iKOSeYOELjiAWC:21 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=KHKEB8RYcew9Qe18FDUA:9 a=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-ORIG-GUID: Vp0WYd0fwaS09HZq7d-5QERCUkIKDxAc X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfXw7O9Uyw6uM22 8IVuWZteWpLNq5Nm5oHZal3W4Qa1z5+fXuEt+7rWztPWffGKjBjw9mI5oO9udd5DhEl4XZDFr5p nBKB7kFLzlC8aueLY1XjEnFBewhJr8FVCxzh0EjCui0QSjUTYEIVe9gtMmLRSgLihjg/+FFfpOP g/vgs/RmoJGrblvHZN3GoAsNThPf9ME38npLASAqrsYfBcCyndbhu/9pHjJyOg9EpKRMmc/Oy1q 1IfKKbRkRFWdY5XShJEG1st8eXhIw3jjln+yIL4TDWIqJmRrTd4N8218bHcMqb9yUbxesMWWsB4 ME2P0Pw+r672DXnUHWIPFd/psHUZe/dEocD4TaMxVxX/6qq0pqpv0XRAyTkL/5Q7DqRNrtI5Hzf W7CPXFZtHmhtkKmcN4wX+GrqWBvdjHR5Q5YIzYAUeJXl/Hk7PtQ+kmbYXG+AXEPwVVYvwLEuRFo 6GEWuSUP0YZDdUEgcPw== 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 | 58 ++++++++++++++++++++++++++++-------- include/linux/thermal.h | 13 ++++++++ 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index b38623f6b89f..c9190a03993f 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -567,6 +567,51 @@ static void thermal_of_cooling_device_release(void *da= ta) thermal_cooling_device_unregister(cdev); } =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 *cdev; + int ret; + + cdev =3D thermal_of_cooling_device_register(np, of_index, type, devdata, = ops); + if (IS_ERR(cdev)) + return cdev; + + ret =3D devm_add_action_or_reset(dev, thermal_of_cooling_device_release, = cdev); + if (ret) + return ERR_PTR(ret); + + return cdev; +} + +/** + * 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 @@ -593,17 +638,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 *cdev; - int ret; - - cdev =3D thermal_of_cooling_device_register(np, 0, type, devdata, ops); - if (IS_ERR(cdev)) - return cdev; - - ret =3D devm_add_action_or_reset(dev, thermal_of_cooling_device_release, = cdev); - if (ret) - return ERR_PTR(ret); - - return cdev; + 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 26e33c0236c4..3b21b47de7c9 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 Tue Jun 16 19:33:09 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 1C0282DA768 for ; Wed, 29 Apr 2026 16:15:01 +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=1777479306; cv=none; b=h+FjqLjFIX8pABVV0nZx+NC5XrYtVWcYwkuxYXNKLmtOPbHd2IysEJUnKgb96zcSxNH/rWXlKmSxfl6za9q0DUGw2H/BtBgRAkUO1Ve9DpC0me1gMsCsgPdNUoDOCPDKLN/KM8s/hzKDCNsnyQ/1HYZ1FYc3uEpnVjPq/ekGBzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479306; c=relaxed/simple; bh=fySGrZIShH9MyeZKFigUBZwml8ANCT0VYoS7eOl4p3Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qwRPnFsIhH7WBrctGWkmu0yK7bWAcrbRv0RVjumQB/SYbKXSztFAaoyjMXu3sofi4IUgzWEcAxW4qapKLSCAZa6NSlRMgSHhpKdS4sAKyd7wtsueOmKMDbWXrueR9WSzsImjf2yEbehY/I+QMqBzRpSCd3UzASi//9uNfwUeTqY= 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=B4flvHQZ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Zm60xz2b; 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="B4flvHQZ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Zm60xz2b" 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 63TFKVX12095179 for ; Wed, 29 Apr 2026 16:15:00 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=AE7tUJMeByc QH5jUTrg9HLnidqspvmybbPI9mAEDiXI=; b=B4flvHQZoUOhFVlQ81KmQ4CNeHL wuoEDAXUbPhqEizeraB/WXQOXq6vScfVTBKLqKh0zt6VAJOrN0pfgcJuVJsL9aqh H9Xk/MuSCXWo5IxNmKqioqfNXqRrCagawE4Pc1EVc3BhHFXuzITNvXTudCbSK0xW 9BW2QeYc0ltLq4gFefJthGFIuQFi4K1ogE0cHkpSMVWDEbDreQLbEXYl2ihh8r+4 MuGHcJTm2queiSy8cYUW1s6HF5ejup41AfjqtTgzbxx0it4iHgHiher+NmEYxjGS t9ci6bhbZIxMOXpcXTJl8xxEHFdfbFOFqIE5XxVaEoBxDUXOOLykQu9mDog== Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dudh3t66n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:15:00 +0000 (GMT) Received: by mail-vk1-f199.google.com with SMTP id 71dfb90a1353d-5675cb317e3so9969412e0c.0 for ; Wed, 29 Apr 2026 09:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479299; x=1778084099; 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=AE7tUJMeBycQH5jUTrg9HLnidqspvmybbPI9mAEDiXI=; b=Zm60xz2bA02EXB9H2Zh0Z9gdx2gDgM/wa6wT/jw3kkxKlugSHXKs2TpBrEWR/nZekH rH9M1NT0NYbCC70UKLBRBosHnuERwM7/WPTu6CWXZfDbe6qprD8VHGdiUYOjK+VrFU0c SEbCPO7vGO2O18272HojM/Al9kcql7fOt/9i+SB7GFRfEeLLIbRO1hNGEKFM884+4BDW 7b4DCp9+LLQ9huC4gc7wmey+WfuS1TCmDEvCeq/08bVaxc+j9aANM7UgRRlYF06Sdpel Cl/h1GZ8rnLIQJ4o5kCoe4rTg0uX9UWAQdZpIU1+cPfB30Tc7EkVIyh8pdJ5hJc8WkTP t6ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479299; x=1778084099; 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=AE7tUJMeBycQH5jUTrg9HLnidqspvmybbPI9mAEDiXI=; b=Yz7cwHgPRSv9JV7YCCJafR6fo7ejAN1258WpRf5CMxdUCUcGDep8zAFRoKi2mQCjoA yGQ6fFFGJcEJT/Qyt5L5iYAlbtiEyYAOahzBjz/tZJT0Ydi2WSXRYFY2Q790Vfhwpcyi iXAw5bGYbN6apPtvPPoPO1G60ZIkoOTq1ydAIXLURWpTBrIIRwttWv3ywUqttW+YNrER WIbfKAbVNhzrsN+rdezgcv3SKnVK9DNeLOlyE1ZPL7ZuY9iba7KOpmx7pBKzP3I22Lid WDvDyKR0yIm17OZ/eHGFwDXE1KrMuxBbUWrozjTJrw8Dr/jSDN75U6cW0S6l5RO0jNmY SjnQ== X-Forwarded-Encrypted: i=1; AFNElJ8YIdkg0UjflJU1BAFpgHICZYubTWoZChQBz0PEsgKgHvV2lp3DmhMrOvsCIwWZppMiRzuSpFj7Ha+WPF0=@vger.kernel.org X-Gm-Message-State: AOJu0YxlK/BJC+QSLApLw1rgwwHB+et1wB222nvWuxS/QWqC6ogUmuMM HqW8eOS3jZtUaA4IkDT+F6iV7AUTSSEUGl/A4mBi/wB+BkxpgNEfWhewRlByuZ1TER3U4j3r78W IUV/Vp0jdZYFms0ee5XFiau0RQpvplpkPo8UFuiKXCYXRr4GPCBYzZorKRC1Yq4tPc68= X-Gm-Gg: AeBDievdkZ3PfRDuBIW6TbbWiLYx6z0ypHg79ygiev6t7Tn/F4WJakoeNZz+AmPZ1hu kjYKAtpxCzD6kSku2icPtyASvMtwzAu3Ecrf8Ko8iwcwT45ZXSPQCheIyHJlcwORBk0ZNCln6Cs oyka25UyR378azlh/XZMFJe5oTPlQd2SlYOw6vi3nXYAPSYropvE1ijPpUOKTrjlNMamstPrEwm Lqch5GV5u4fEYvt//1YOU9c6zYgOxj7mWxGYWqkilPplJ7dOhUfmXzkijoMxY5q2dRFxLslUXk1 TacXJqku61dNxWEvNPZqnIYNm59psjNx9VtgD5GlikDAgywXHyt83NPvtsxYdElCVJWYwzdlKf5 Ad2nCdLJ5pz+nr3FTmyfx9RAyXIQqHqThaAf3gd80Z0KAgPV3jfxBPAXH75xG X-Received: by 2002:a05:6122:8b11:b0:56f:a3e2:66a4 with SMTP id 71dfb90a1353d-573a554f7d3mr5292046e0c.1.1777479299467; Wed, 29 Apr 2026 09:14:59 -0700 (PDT) X-Received: by 2002:a05:6122:8b11:b0:56f:a3e2:66a4 with SMTP id 71dfb90a1353d-573a554f7d3mr5291995e0c.1.1777479299064; Wed, 29 Apr 2026 09:14:59 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:14:58 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 Subject: [PATCH v3 10/11] thermal/of: Process cooling device index in cooling-spec Date: Wed, 29 Apr 2026 18:14:23 +0200 Message-ID: <20260429161430.3802970-11-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: d1b06i40zEo9hpoifXP1t269u1ccbEML X-Authority-Analysis: v=2.4 cv=A4dc+aWG c=1 sm=1 tr=0 ts=69f22e84 cx=c_pps a=+D9SDfe9YZWTjADjLiQY5g==: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=s4Kp2nOrnj-iCWvMcIQA:9 a=vmgOmaN-Xu0dpDh8OwbV:22 X-Proofpoint-ORIG-GUID: d1b06i40zEo9hpoifXP1t269u1ccbEML X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX0cHljuPcJ0SV gJEmHvYfG+xVGF7dIuzjcMTHUfkGXlF4tU4GY403WN/G53OhdK8wKON2UUD9A9FoRaRqT3UhS5r CLa2W37h3rwRNSbibxBczrBSCRqnN4KK/iKTG6o/Nekw3XdtepFgFlsU0TYJu5ZSU9hlnXfpwr5 hByqXoKyOQVTLh1bncKdg/xWVOjO84RnZwgp1Kb4kEKjj1sXX+cASghes38fvNpQJegi8hIgDzp EXbXaQfZr5rPMSKtFUs6xSP/xrgTLbC2X6+xRfe2NGgr8n5addS718OvEQh+2ncTIIaquMQiMJz s4dx/U6lo0SvoOqkCjm23QMHS7GLVb0ztNLzpwVA6s9hKOvW/lu4Z8dcdtURmcx0D5bjrkZSn/i 7drm3CC1kQ0Vhmqidzxb5QzSSWd1lO/Mdx2lsuRwQLzCtmfz2PyaBOsP1ZworHu79jL1Kaa/XpO 1k7r5EH5yoc9W2gj3fA== 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 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 | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index c9190a03993f..1c944daebec3 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -259,16 +259,34 @@ static bool thermal_of_get_cooling_spec(struct device= _node *map_np, int index, =20 of_node_put(cooling_spec.np); =20 - if (cooling_spec.args_count < 2) { - pr_err("wrong reference to cooling device, missing limits\n"); + /* + * 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 < 2 || cooling_spec.args_count > 3) { + pr_err("Invalid number of cooling device parameters\n"); return false; } =20 + 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 Tue Jun 16 19:33:09 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 BCF2740245A for ; Wed, 29 Apr 2026 16:15:03 +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=1777479306; cv=none; b=Ql1KxkuU5P3cTOLbe0fC8q6A4+jXLFt7kB8wlFvs3d6CNNRmx3Q2i8jy0633/HM5LSbjv9OWb6XD3x+ZnYHBj74NmrMAyKgpE8az3Ba+DYO4psi1s5KBHqh9RnFrT+LEYv8vqgpxVL7PsJduEjm6nGwBY9FXYInNWnoGPdtmj+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777479306; c=relaxed/simple; bh=0hqwleN+hGYWOPBNiXuqMAKygpx6yIPIDHS/duN9w3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pyvEN+ZagAJpaeXYX3vipqai+75lTmrySE1DqChXaVOX7xO0vjos1fRxHI+ZbGiYJX/ELlvWs0i9iK37TaRsl0IjAGZR1EHBg3h9jkiTCezk926/qktHqzyCBzUkSW3IgEWRmdHXyC9EH9eArdDQ78iRA7YGdz+4RREtI8DHOig= 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=R9WDmL0b; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=a4oYuKGB; 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="R9WDmL0b"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="a4oYuKGB" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TFZHqt1641533 for ; Wed, 29 Apr 2026 16:15:02 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=WKIGIXDHh9X 0RP427er22w6scCsGhci8yorv+QWR6Ao=; b=R9WDmL0b7l2UUA9WUXk12qBecj3 Zqzn+0RElZ5Wr2DDnRGDSVg7WZ/D0T0tBvW05yY+/1G7bW+nP6HEg7Tta+T7T/lq 6McZmPRf48leve06DYPIE2OaM3JmoXwQPIA+pHUdmryKfzwp4Oje3h+7XKirv5lw oVShu2SuQfkbDkJMqyquhBl6oIjzbPydjdiLvQJ5iXNJRUD1OaxyPF5wARasplPL g6LLTicWm2HLI/MiPkJW0sErqbOdPhFAJlq9ATiWkRmKVGXyH56LjHgvWSentj7g vQmvnLSwworO/R5eFrnmfwxbKM/jbssDzQi2NOtMJ/xzz0BqvzD7uDMUdpQ== Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ducj82df5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 29 Apr 2026 16:15:02 +0000 (GMT) Received: by mail-vk1-f198.google.com with SMTP id 71dfb90a1353d-56b67e8c2f5so15857149e0c.0 for ; Wed, 29 Apr 2026 09:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777479302; x=1778084102; 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=WKIGIXDHh9X0RP427er22w6scCsGhci8yorv+QWR6Ao=; b=a4oYuKGBmXF1uRqqrstJNCP3emZgqeJxncTiG0qs1UCRLswj2TCvgvyLVxGn/Tfz8f XEAZMdHNigfzpH7Sbhpz+DAjZjXcVXDURViIIIcmvvXm3LjGX3Yb5PHUC4mZ87XQKF88 y8vml3uSZzyNW9qLpFVhicpVfCAsCVz7DM/7U/IKeIahoT6Y0mK1Oyqf1uAhw5equ6np CpnaqOWx8I98ybEqXEZea+zvGaheiCNqhBCyfgz9XQYPiHViSX4L+3EgzHpxfyTTdTzt +bKolGP24ZbBXL5ovK3N/N/VWKAFxIFigpUU2CqDaubg2q05cZXvwCIq0qkMkr1md22x ekjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777479302; x=1778084102; 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=WKIGIXDHh9X0RP427er22w6scCsGhci8yorv+QWR6Ao=; b=Cajzf35n9OEbJYgFtG0gT9GZiLjMAnddpf5vPqGZXcthFkIniFvPwi6Oq1EzvtNvgI dhikl/R2pnXSF3mkYSdrwdvUyshsX5a+RXaIu6QVbBfcTQSHL1/xdIqJN2eW8DmhrEJU OOGLaeMFPhLfP1DbTmcjW9EexqV2/awsxXCT4bdoBpR4LBzg47mA0Z8Nh+HDGGuTKu48 WJNGrUe+h4zIK9+e8pYx58aTECZr9Rt+K/YbRRTusc/sgLbRX3u8F8PlOoO+T1boFNWj DeFmPBTV7HtKNgsHNINqqiHhhQeKDzZD0Iyee0lnmQfpT4CfP1d7CP/fFcTsyVKJWj4f jSRA== X-Forwarded-Encrypted: i=1; AFNElJ/N6yJXLPQ1LyaJyPktreO+Q8HtM3Mlc/L11jZRHIJjFfqO7vNlJR7s+eyDSwj+0FDgSQNA+CkEww7vCPQ=@vger.kernel.org X-Gm-Message-State: AOJu0YylkLQUl864QfcvuQ8e5ITEWQ/3kVYSKOKgUZdRW+ZUBv65JO5p aMa83PkmT35DugE1e/3qPN2lbrp61565/8lG2BRzLgU2WCFu4iO8jIHX2uFmaQp9KO0CBJrI9pF jYf+NIL+beU8WBcDfPP8i/dGBe//FmqHq7N/aP+6D/0s9q5wyCUji0HjRgs0RxYzMtEA= X-Gm-Gg: AeBDiev+8wlAeNJwxJNYDTcqlJFA+6VbrFvYjKXv486eoL7xA2q1VOaQVHVZR0pljxp R1fvMEOvFVuPi8Z5/O+CVmGhqab7VcAB596xLelgnOtQJw0/TlRN+g8lXPvYY30dZnUi3Z6cEi7 xF0h3q6MuBLOqDYoy4sM7g4qdBKbZWNrNtFI0fHmQqVJrqznpXYlTw8wCdaB9nu4+WR0yQ1VyKZ FhAXkf1LjCTu/sKIlqgAsWx042fLZvZjxkcKqmRNQAugJFCoiJ1umP//DQfgbi25fKKcK82MNli ExiNrnRcNS6eEDKD7ZOgmeTyGCZcUtrrGPxg1ir9mM7VkZdG4PQD0P13OO9kISDxxxxISIzRGan +VfEJfFadaAO0weu/hj56vyGJ7mcOQo9TQZxnhxDCiUdXOIp6VOaFlKOM1g0+ X-Received: by 2002:a05:6122:45a5:b0:56b:815c:961d with SMTP id 71dfb90a1353d-573a5580601mr4806215e0c.5.1777479301553; Wed, 29 Apr 2026 09:15:01 -0700 (PDT) X-Received: by 2002:a05:6122:45a5:b0:56b:815c:961d with SMTP id 71dfb90a1353d-573a5580601mr4806128e0c.5.1777479301015; Wed, 29 Apr 2026 09:15:01 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a81ed659dsm2438525e9.2.2026.04.29.09.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 09:15:00 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org, daniel.lezcano@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 , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS) Subject: [PATCH v3 11/11] dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device Date: Wed, 29 Apr 2026 18:14:24 +0200 Message-ID: <20260429161430.3802970-12-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260429161430.3802970-1-daniel.lezcano@oss.qualcomm.com> References: <20260429161430.3802970-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: FuGfY_cu-wtL6pq0i6Cbatw_KL8-0qm4 X-Authority-Analysis: v=2.4 cv=RI6D2Yi+ c=1 sm=1 tr=0 ts=69f22e86 cx=c_pps a=1Os3MKEOqt8YzSjcPV0cFA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=WD-cMf_r4H3F8z8mj00A:9 a=hhpmQAJR8DioWGSBphRh:22 X-Proofpoint-GUID: FuGfY_cu-wtL6pq0i6Cbatw_KL8-0qm4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDI5MDE2MiBTYWx0ZWRfX7QQg1XC5TPlL gU1e8Xc+tq8lml+4jqbhXCgbuyXuj0js5z4Vy9B8j5rhMeu2ipS85zF7ZasDkcwKtynouHGqB8d hj1AfojU2xzSVvvU7RHOVj2XeuSe5bE5fv2TcJobCb24hLiLXKpBrkjVNg1p6Z+s8ZjsY6ok93O dw4usgSZpwVpx/KjTyqOPB+Tz9BfnMW2HqxVt/TmTEy03qG4zHGitNumheqaa097DS8ScSTICo4 MBof9LYZhZ3YZsj4ICTVNoqOhi+AjNbi/d5ZILuOce1Ibv/JNEd06D3xzpmVYTkWO6YKpswyytY KJRfCt2PEiMingXM+66YaF9SdffDKZzBw9lHEpab3UQVyyxAcZhs8blqQyvh1ez/PHqMfyBoFPA r24cqABRXbOg5mmMQopY8qakSRy+MBHLyYjG++qf2TSnKdR6v1ertcCwyQkLI/pN8rqRI6YFTQO nWEADc4M7s8W/IO0QEg== 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-29_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 impostorscore=0 bulkscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604290162 Content-Type: text/plain; charset="utf-8" From: Gaurav Kohli Extend the thermal cooling device binding to support a 3 cells specifier along with the 2 cells format. Update #cooling-cells property to enum to support both 2 and 3 arguments. Fix pwm-fan.yaml to restrict the number of cells to 'const: 2' Signed-off-by: Gaurav Kohli Signed-off-by: Daniel Lezcano Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/hwmon/pwm-fan.yaml | 3 ++- .../bindings/thermal/thermal-cooling-devices.yaml | 8 ++++++-- .../devicetree/bindings/thermal/thermal-zones.yaml | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml b/Documen= tation/devicetree/bindings/hwmon/pwm-fan.yaml index a84cc3a4cfdc..6a24851fd80d 100644 --- a/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml +++ b/Documentation/devicetree/bindings/hwmon/pwm-fan.yaml @@ -63,7 +63,8 @@ properties: description: The PWM that is used to control the fan. maxItems: 1 =20 - "#cooling-cells": true + "#cooling-cells": + const: 2 =20 required: - compatible 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