From mboxrd@z Thu Jan 1 00:00:00 1970 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 498B02EB5CD for ; Sun, 19 Apr 2026 18:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622959; cv=none; b=uZHVSVD5kGv6gemP+r1TGyBCTP0ozneUitfViU+/P4eWaZu7CFt9Eo84S3qDsXVuM66MXpqjs/elVWq2+3WgQ8Byim8KpuWZQ7J+CV0byU0ZBCdFdDlAlfLFrurIYQKaRzC/ZCXEpRrBCFwJiCoZDlhyqn1xXrecLKxjXeKZ7tM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776622959; c=relaxed/simple; bh=zQ2ofjxFIwHsuU2VATPBF3BRMsEnwHwCQHXoZhFa900=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LUag/TGf9/FWiGklD2BGRcZc8BIlJrkjJY/TZ2SFQVB5ohO7veHfgq0IrER4ncvvkcANuwYvEP6wFro3Yf5DeTkZ/apGYirHDvejPCeXG5TKby8kQTjWGq8dJErKdjqFXMuwV0yppim5cpgUkR3bdQSsaTAG0ioLPlGvfHsSHtM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=kVz081no; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GG31VXF7; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="kVz081no"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GG31VXF7" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63J7vYKn3328439 for ; Sun, 19 Apr 2026 18:22:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=4+JHC4i+rBj /UbYPMg6c3yvjyW0+p6HwFWy5SgpbUGE=; b=kVz081nouZ/JfyllbxjSJxb4QdX cewdwEC02fEp1GmXHQq7tOxv4jY02J7kV/lr65ohyvhcejmLY3j+57xjBLxlmhpB aXBqjiMp3hxiHOzu25KiKhUYZW6vqcTbd81ZJt0I9UB0wth4yAb2fP5wWKuV2gG9 11hYoYpJU/Z5J+qMrmYeblw8Je7bfdkjbGpCe2Ov1LMt+5+anEiSwPB/qSDWpE05 KAN0hkgHIDV5bP0pgtZvuU5aJqTAiPFsjBjlOJtfRSe1gtrMjfEdnXMo5zULRsQA APVJfxRuRwfm5ZPuxc1YvOb3TBnQAihpeTIpSdQQFF5iC6Iy0bieQ2ub6Zg== Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dm1hx31up-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 19 Apr 2026 18:22:37 +0000 (GMT) Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-50d826ed6f9so78237351cf.1 for ; Sun, 19 Apr 2026 11:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1776622957; x=1777227757; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4+JHC4i+rBj/UbYPMg6c3yvjyW0+p6HwFWy5SgpbUGE=; b=GG31VXF7uwCGPVQ3eNqG1hLm25DqTCSm+MAJtsh33b7jCJEbzxfSj59LViGw0AOfcu Y/HHmQceZCmxzcnuxNk4HdzRhTLzaLQiZyFAgKyEOWZQb9IkKFNgu0jUxbRfTEcuOlaH i7dSpMXywlRSjPmFaddu0St4AEREXgChV6Xc8xgcfpr3X0xmI0NFv+81r5AutraaeQcY FjZ4snXybsfQZoIDCkXh+x0f1JKqu9A8Xu2dWR9hW2mxDtYUElYG7vYWKUh/0Mljvp3O knPYrF2luOXkfCPh8GTDVvYXUPCUNP1h6ly5j7H9FZm12txCAT7XkS78IFjXvVmUVxFu TaXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776622957; x=1777227757; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4+JHC4i+rBj/UbYPMg6c3yvjyW0+p6HwFWy5SgpbUGE=; b=A18W8019QhlJUtEyd8r+QOCCGfKQS8iv1beiiPl43zUceI4VjUrQhZLcN0cbv7OyyD RZhGNFUKcLZOVIFrDfCDKMfvySPDYoqPgZ9ftWeA76twjjMXaIh+l54uRLm7ueLlqg65 vS55K9flbPQ31zXINgsj2PM7NijCc4X1v649ev6RJJ0fK376foiejS+OwqP/x1qnNfsT JCwR0EE2lcKanMKTQ2Igne0oHKcCSDnZb3gOOEG6dnGBraLtmUqnBQxcPcTNGA5lVxum DOfx1wo8ZIcqG+nzCDWiiz5CoALeUbABERdNn6BDbuj8NQ7typNDuCXAIJC3of4rDsUx dzXg== X-Forwarded-Encrypted: i=1; AFNElJ+DCT20nk26rjdXJaPJd/T0/HAhZWQEaw4wXMhYQkhe5d2htyxt18nrpzkpmqC5HRfd79u8HVmxztJB8A==@vger.kernel.org X-Gm-Message-State: AOJu0Yw4bgyN6/O+/bgca/4CWaclZ3YE4tSrUxBiL4vCvbTjm6qs8CzM ZsYhUB/+dk+dvXI6NEijsTp63EIbS1NgzNz3csnHUGM4bAkhixT8fDm91Yo1rtnLfCoUBiAoMZg w4JeHLhx3qh1CRF7fLWIqMGSLfOHiJvNPDtfpqs9fOarJbnwPQ7sXeJl6jgfT+0/aow== X-Gm-Gg: AeBDievci7JOI2FDGwG1taS5k4dGi7aRmwqv9jZBViksW3Q5Ggb5eQny/44VA/LpcvY bG+364JVbJ2g1aM9bEo15BhGcepDqFpZN6cmhtbGHnL37pZYrMa28yfuW1hQyd6aDeByf5eUU3G E6NFL4+9MZX/P+Fmj8h7bZWZoF58xlkUBehTyjuHwtq2cjVo0mEW/Y/z/y28qP25rRpp+/8Abfd K9ZkkEenuQGhpwL+VS84bh5HoWECcI5y+WdskuJwwBgVbx9C7rT5ua9WKlS+PBk+xfQFM1WRxcf 3XquouTJEgCRi4h3ZU6wjd8UNts+5n1xxyvRak25eOR7zO9ktcoxPwo3bCgkYxeRxXmkYuG4JZR HSBYAPke++V1qC8lq1dy0KYBQylnrdSIEn1l6SF/8WNYNFFfUKghLzv2yRHZV X-Received: by 2002:a05:622a:112:b0:50b:328b:cd41 with SMTP id d75a77b69052e-50e36737912mr124060281cf.20.1776622956719; Sun, 19 Apr 2026 11:22:36 -0700 (PDT) X-Received: by 2002:a05:622a:112:b0:50b:328b:cd41 with SMTP id d75a77b69052e-50e36737912mr124060011cf.20.1776622956225; Sun, 19 Apr 2026 11:22:36 -0700 (PDT) Received: from mai.box.freepro.com ([2a05:6e02:1041:c10:ae20:597c:99b8:d161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43fe4e59f97sm25723070f8f.37.2026.04.19.11.22.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 11:22:35 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: gaurav.kohli@oss.qualcomm.com, Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lucas Stach , Russell King , Christian Gmeiner , David Airlie , Simona Vetter , Guenter Roeck , Joel Stanley , Andrew Jeffery , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Benson Leung , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Heiko Stuebner , Thierry Reding , Jonathan Hunter , Bjorn Andersson , Konrad Dybcio , Amit Daniel Kachhap , Viresh Kumar , Neil Armstrong , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Daniel Lezcano Subject: [PATCH v1 03/14] thermal/core: Make thermal_cooling_device_init_complete() non static Date: Sun, 19 Apr 2026 20:21:47 +0200 Message-ID: <20260419182203.4083985-4-daniel.lezcano@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> References: <20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: riJxGrGYFXLm4gIP1a3MovRnwKrcw5Sd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDE5MDE5NyBTYWx0ZWRfX8Dr6P+sqNIi1 pD6uilI9ICO79JUSUHisiEtVk4AsV/a1E5DyPEzc5YPgazhU+IvfN+9gv2Dy1tw0/TuM03WBGhi UHEZ7YSEEohhwpR9bXICMlLy/pv9FaVQMevGBPLbqnTyFscqhl9/BskGSNSpdSiDLA3ZSGRVh9E GAG1PnBeKpGXgFDS9iqO7El/oux3hzSvXWkm7MQZkNyP5+QdQ3m1R6wtOfRdeWCp1dRPIUwB3oW OjpizQtJGc6/DDAo3ML0bUcsw+eTDM7XJYh8WQNCUs/dQI7H77K0Y2ecnJeWpg97Bp4w1de8MNY yrruyEHsmvry3j8JSJAbFnUnBJvepqCif7j85Rp3Q8XvCKgcmfJI7miYv+qQjShWxEd5/at8o6r PkTbVvfHRv1yT2mInjUT/Y71dpashKVfhTuCHDC5jnp9HV6Vyw/fGSIv1O0FoY5lQIC9aJ/Uf7a kT/lg7YM4qhlQWnHlyA== X-Proofpoint-GUID: riJxGrGYFXLm4gIP1a3MovRnwKrcw5Sd X-Authority-Analysis: v=2.4 cv=RoX16imK c=1 sm=1 tr=0 ts=69e51d6d cx=c_pps a=mPf7EqFMSY9/WdsSgAYMbA==:117 a=xqWC_Br6kY4A:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=XCaTwWLIzJkqVeeR-uYA:9 a=dawVfQjAaf238kedN5IG:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-19_05,2026-04-17_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604190197 In the process of separating clearly the OF code and the thermal core code, let's split and export the thermal_cooling_device_init_complete() function so it can be used by an implementation inside the thermal OF code. Signed-off-by: Daniel Lezcano --- drivers/thermal/thermal_core.c | 12 ++++++++---- drivers/thermal/thermal_core.h | 2 ++ drivers/thermal/thermal_of.c | 10 +++++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 8a70768b46dd..35cf170f3fa1 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1028,7 +1028,7 @@ static void thermal_zone_cdev_bind(struct thermal_zone_device *tz, __thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED); } -static void thermal_cooling_device_init_complete(struct thermal_cooling_device *cdev) +void thermal_cooling_device_init_complete(struct thermal_cooling_device *cdev) { struct thermal_zone_device *tz; @@ -1127,8 +1127,6 @@ __thermal_cooling_device_register(struct device_node *np, if (current_state <= cdev->max_state) thermal_debug_cdev_add(cdev, current_state); - thermal_cooling_device_init_complete(cdev); - return cdev; out_cooling_dev: @@ -1159,7 +1157,13 @@ struct thermal_cooling_device * thermal_cooling_device_register(const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(NULL, type, devdata, ops); + struct thermal_cooling_device *cdev; + + cdev = __thermal_cooling_device_register(NULL, type, devdata, ops); + if (!IS_ERR(cdev)) + thermal_cooling_device_init_complete(cdev); + + return cdev; } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index bdd59947b24f..6e44bcf37b00 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -269,6 +269,8 @@ void thermal_zone_device_critical_shutdown(struct thermal_zone_device *tz); void thermal_governor_update_tz(struct thermal_zone_device *tz, enum thermal_notify_event reason); +void thermal_cooling_device_init_complete(struct thermal_cooling_device *cdev); + struct thermal_cooling_device * __thermal_cooling_device_register(struct device_node *np, const char *type, void *devdata, diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c index 398157e740fc..35d542aac7f8 100644 --- a/drivers/thermal/thermal_of.c +++ b/drivers/thermal/thermal_of.c @@ -531,7 +531,15 @@ thermal_of_cooling_device_register(struct device_node *np, const char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(np, type, devdata, ops); + struct thermal_cooling_device *cdev; + + cdev = __thermal_cooling_device_register(np, type, devdata, ops); + if (IS_ERR(cdev)) + return cdev; + + thermal_cooling_device_init_complete(cdev); + + return cdev; } EXPORT_SYMBOL_GPL(thermal_of_cooling_device_register); -- 2.43.0