From nobody Mon Feb 9 12:09:40 2026 Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 2C0F73093A7; Thu, 20 Nov 2025 03:41:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763610102; cv=none; b=EkjXAsgSDb6pigVMFJKnSPvomIinG9jhYGg0dxKX60yL9lTiyO3dqnbdNHGvp5OsSOoHjeKIZF337VyS7lQmJuxEzCM0g2fGJx15e/+yoZroSTU1zk2ThJGDkBgG+gY6fodcYyEeWbBQDQPBpjiaNSJyHMC/OZmkB01V2RYS7nI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763610102; c=relaxed/simple; bh=g3eMEoN8Q0WX3yAGcoSA+a4Z/MFKpjfEmuhn68vfiKo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q6LR9SliQZdOjAe3LcGnLObAp6uSUBiYpRPzPdw5j/xnTMk+vqU7L0AtQzQPjEp0iakMOX7Wcjj6JdcfNG5x7JMPg+JGYkR+A5aZTC1NJKg6OtxCcC0OmgH/qnHAVro7XkuAHFjQw+5NdVU6TFoCZF8kMluSkRoahyt9inIlldI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de; spf=pass smtp.mailfrom=gmx.de; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b=aKRIWuba; arc=none smtp.client-ip=212.227.17.22 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmx.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmx.de header.i=w_armin@gmx.de header.b="aKRIWuba" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1763610097; x=1764214897; i=w_armin@gmx.de; bh=2kOZ2qGDbUtlfM0lfAWL+CuCYcvOT4XDmaR4zoAjfg0=; h=X-UI-Sender-Class:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=aKRIWuba0IAdSUR2MXvDkorv86Y1ma2GufVCsqO7RDi044SaUcUeLfJRCsvWhOJZ 8lZCCPrDPiIwpKYFe92yZ7cl+oQBk5PdsXE9QtVfJHT6fY/4WyTWm3RVh9+1pvNYT XOTtdu+Py5bMANyXWChVUNV/XOqyhDY6rkxskQXa4PJMhZ4HXSdcmbwKt8z6pWvDw AOqOqQglEo0n2sNgSc13QNRZNO8l0YSQyF5TE8XSk/gx3MT4ZSL/gSh0NODa1+a94 b4HGwJ9JmaVnftC4QqsZpRQ7DpGBZEyNTe2pZUU+7gAYi2dJyimmLuWgp/RsZCQk6 MgBVjHxoIbwuoDuL8Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [127.0.0.1] ([93.202.247.91]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MHXFx-1vQeUz3w9p-00FRNj; Thu, 20 Nov 2025 04:41:37 +0100 From: Armin Wolf Date: Thu, 20 Nov 2025 04:41:16 +0100 Subject: [PATCH RFC RESEND 6/8] thermal: core: Set parent device in thermal_cooling_device_register() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251120-thermal-device-v1-6-bbdad594d57a@gmx.de> References: <20251120-thermal-device-v1-0-bbdad594d57a@gmx.de> In-Reply-To: <20251120-thermal-device-v1-0-bbdad594d57a@gmx.de> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Len Brown , Jonathan Corbet , Ido Schimmel , Petr Machata Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, ath11k@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, platform-driver-x86@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.3 X-Provags-ID: V03:K1:4cIbWlrQp5RG0n2sdwfhJ6mqPNnFdfuw6wKcvDWlILFAv7qB4Kk KqQuPEi4WwVoI3o132IYI+euD43CiKKHwCpQCZNpS6bMVqqmIv2AW0/pM3zKghPVVUzAlVw QhugDQFsCGPrviBIOLioCsXA6xffXkGkUjh/U4M/vLy/p/zKDgcqUYeENmR7spTp54/Q6Uc nFlDNc2B7nUFaUiFctdJA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:P3U7megnmYM=;50+IRZ/J8/lMb44LA+JADkKOOMq il4Jm7Vs3ejlr8VL3Edd3jn3NwB9ZinnasBNSdFS/V7k2y6AWi8Y98OkC6bySr+vNOXqW0eQV 2Q7b/tgNH73MO2JRq4bHL9E7BpDYP5gORx/ClW6cENwv/fUVQ6ZADryPHUd4Iuo7r3QVZUTi+ besk8+x8XVshK9vpLbQ4jT3AWq7NzlxwiMRAh78B9tGU6UIg3+canT/AC74WElxFWMNh2SEiT XBgVIQitFA9heHS5zDc0W7Rvr/c8QQmFGXJKiGVhqRd6dKdZLA/50TMOBGSaDyp4c1juB3/O+ +8nkqhCgiT2jYtALimyJhWPmcH8pXGdlWB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xs7nJBSn6NgUynxim3nKsJgDz6ZSIPOaqbX1kNwhomYphxKzBT/kCh84HBm6urkCW 0zKkWQZTaS/YF+qMFl2P921j3ETkph1i3TuqEFQMXSA85iSxIde+RGYCpJNuzvt6psO5ht3X4 WQEFWuxqrI5BviJvBSPIqG/HzIyS+MnxHU/6rHoe54ZmyqyQ2OTwWIXqQvQPjwOE4koAbxUoN +ANKsKvaGVuiiul8gbC6hPPFTcu9FHn2TFGRV1Vb4KXKV1noHzWgb7fmJsDAa6NMX4QN1njbC PVMCWU75xkNI44hWD29zSWRHDKu3SpVEHl5GFu9lK6b2TtYJaPgthCGjgi1beMCwjwDyJAXcZ 8e/0Brv4rPZe7assrWOmR0BX6qq6nPqmSWTKf/G8A+8K6NJ0qnc/WDW3skaost5dIKxC0SaLc qo6ewaeQMX1gpFnv6akQSW1lGEOsJVBJZuffL4VeYa0+x+22TemQgP1BWirrNQzbC+ZtUilVP bL7npE84wZdn7HxanocnD6oePhLqjUHtD1fjKOCLXTi43FOdepgNFyuTWuAegqxTJPYlhRmp6 6tUSa2kbBDzA+IwwoCF33BdZWDQoUCIol2FsFYulwdwbR34UlYvuDujxUB7Brh/T1BwVg3ii+ D+g+ND8CQLykQNoG4g8heDLsFQhGM Extend thermal_cooling_device_register() to allow users to specify the parent device of the cooling device to be created. Signed-off-by: Armin Wolf --- Documentation/driver-api/thermal/sysfs-api.rst | 5 ++++- drivers/acpi/acpi_video.c | 2 +- drivers/acpi/fan_core.c | 4 ++-- drivers/acpi/processor_thermal.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 2 +- drivers/net/wireless/ath/ath10k/thermal.c | 2 +- drivers/net/wireless/ath/ath11k/thermal.c | 2 +- drivers/net/wireless/intel/iwlwifi/mld/thermal.c | 4 +--- drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7996/init.c | 2 +- drivers/platform/x86/acerhdf.c | 2 +- drivers/thermal/intel/int340x_thermal/int3403_thermal.c | 4 ++-- drivers/thermal/intel/int340x_thermal/int3406_thermal.c | 2 +- drivers/thermal/intel/intel_powerclamp.c | 2 +- drivers/thermal/intel/intel_tcc_cooling.c | 2 +- drivers/thermal/pcie_cooling.c | 2 +- drivers/thermal/thermal_core.c | 5 +++-- include/linux/thermal.h | 9 +++++---- 19 files changed, 30 insertions(+), 27 deletions(-) diff --git a/Documentation/driver-api/thermal/sysfs-api.rst b/Documentation= /driver-api/thermal/sysfs-api.rst index f73de211bdce..cf242cd16f2e 100644 --- a/Documentation/driver-api/thermal/sysfs-api.rst +++ b/Documentation/driver-api/thermal/sysfs-api.rst @@ -215,13 +215,16 @@ temperature) and throttle appropriate devices. :: =20 struct thermal_cooling_device - *thermal_cooling_device_register(char *name, + *thermal_cooling_device_register(struct device *parent, char *name, void *devdata, struct thermal_cooling_device_ops *) =20 This interface function adds a new thermal cooling device (fan/process= or/...) to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries to bi= nd itself to all the thermal zone devices registered at the same time. =20 + parent: + parent device pointer. + name: the cooling device name. devdata: diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c index 658e11745523..eae1ff9805b1 100644 --- a/drivers/acpi/acpi_video.c +++ b/drivers/acpi/acpi_video.c @@ -1759,7 +1759,7 @@ static void acpi_video_dev_register_backlight(struct = acpi_video_device *device) device->backlight->props.brightness =3D acpi_video_get_brightness(device->backlight); =20 - device->cooling_dev =3D thermal_cooling_device_register("LCD", device, + device->cooling_dev =3D thermal_cooling_device_register(parent, "LCD", de= vice, &video_cooling_ops); if (IS_ERR(device->cooling_dev)) { /* diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c index 2ca3e347f15c..7ebf2529fbfd 100644 --- a/drivers/acpi/fan_core.c +++ b/drivers/acpi/fan_core.c @@ -584,8 +584,8 @@ static int acpi_fan_probe(struct platform_device *pdev) else name =3D acpi_device_bid(device); =20 - cdev =3D thermal_cooling_device_register(name, device, - &fan_cooling_ops); + cdev =3D thermal_cooling_device_register(&pdev->dev, name, device, + &fan_cooling_ops); if (IS_ERR(cdev)) { result =3D PTR_ERR(cdev); goto err_end; diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_ther= mal.c index 1ff10321eac5..a7307f5d137f 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c @@ -313,7 +313,7 @@ int acpi_processor_thermal_init(struct acpi_processor *= pr, { int result =3D 0; =20 - pr->cdev =3D thermal_cooling_device_register("Processor", device, + pr->cdev =3D thermal_cooling_device_register(&device->dev, "Processor", d= evice, &processor_cooling_ops); if (IS_ERR(pr->cdev)) { result =3D PTR_ERR(pr->cdev); diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/n= et/ethernet/mellanox/mlxsw/core_thermal.c index eac9a14a6058..1117d59b74fd 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -693,7 +693,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core, mlxsw_cdev =3D &thermal->cdevs[i]; mlxsw_cdev->thermal =3D thermal; mlxsw_cdev->idx =3D i; - cdev =3D thermal_cooling_device_register("mlxsw_fan", + cdev =3D thermal_cooling_device_register(dev, "mlxsw_fan", mlxsw_cdev, &mlxsw_cooling_ops); if (IS_ERR(cdev)) { diff --git a/drivers/net/wireless/ath/ath10k/thermal.c b/drivers/net/wirele= ss/ath/ath10k/thermal.c index 8b15ec07b107..16eb41b928ba 100644 --- a/drivers/net/wireless/ath/ath10k/thermal.c +++ b/drivers/net/wireless/ath/ath10k/thermal.c @@ -161,7 +161,7 @@ int ath10k_thermal_register(struct ath10k *ar) if (!test_bit(WMI_SERVICE_THERM_THROT, ar->wmi.svc_map)) return 0; =20 - cdev =3D thermal_cooling_device_register("ath10k_thermal", ar, + cdev =3D thermal_cooling_device_register(ar->dev, "ath10k_thermal", ar, &ath10k_thermal_ops); =20 if (IS_ERR(cdev)) { diff --git a/drivers/net/wireless/ath/ath11k/thermal.c b/drivers/net/wirele= ss/ath/ath11k/thermal.c index 18d6eab5cce3..363697ce8641 100644 --- a/drivers/net/wireless/ath/ath11k/thermal.c +++ b/drivers/net/wireless/ath/ath11k/thermal.c @@ -172,7 +172,7 @@ int ath11k_thermal_register(struct ath11k_base *ab) if (!ar) continue; =20 - cdev =3D thermal_cooling_device_register("ath11k_thermal", ar, + cdev =3D thermal_cooling_device_register(&ar->hw->wiphy->dev, "ath11k_th= ermal", ar, &ath11k_thermal_ops); =20 if (IS_ERR(cdev)) { diff --git a/drivers/net/wireless/intel/iwlwifi/mld/thermal.c b/drivers/net= /wireless/intel/iwlwifi/mld/thermal.c index f8a8c35066be..9e56e6e80ab7 100644 --- a/drivers/net/wireless/intel/iwlwifi/mld/thermal.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/thermal.c @@ -366,9 +366,7 @@ static void iwl_mld_cooling_device_register(struct iwl_= mld *mld) BUILD_BUG_ON(ARRAY_SIZE(name) >=3D THERMAL_NAME_LENGTH); =20 mld->cooling_dev.cdev =3D - thermal_cooling_device_register(name, - mld, - &tcooling_ops); + thermal_cooling_device_register(mld->dev, name, mld, &tcooling_ops); =20 if (IS_ERR(mld->cooling_dev.cdev)) { IWL_DEBUG_TEMP(mld, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wire= less/intel/iwlwifi/mvm/tt.c index 53bab21ebae2..b184f08230b9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c @@ -744,7 +744,7 @@ static void iwl_mvm_cooling_device_register(struct iwl_= mvm *mvm) BUILD_BUG_ON(ARRAY_SIZE(name) >=3D THERMAL_NAME_LENGTH); =20 mvm->cooling_dev.cdev =3D - thermal_cooling_device_register(name, + thermal_cooling_device_register(mvm->dev, name, mvm, &tcooling_ops); =20 diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net= /wireless/mediatek/mt76/mt7915/init.c index 5ea8b46e092e..cb08bb36f6e2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -200,7 +200,7 @@ static int mt7915_thermal_init(struct mt7915_phy *phy) if (!name) return -ENOMEM; =20 - cdev =3D thermal_cooling_device_register(name, phy, &mt7915_thermal_ops); + cdev =3D thermal_cooling_device_register(&wiphy->dev, name, phy, &mt7915_= thermal_ops); if (!IS_ERR(cdev)) { if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj, "cooling_device") < 0) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net= /wireless/mediatek/mt76/mt7996/init.c index 5e95a36b42d1..bb6e55d79d0e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c @@ -249,7 +249,7 @@ static int mt7996_thermal_init(struct mt7996_phy *phy) =20 snprintf(cname, sizeof(cname), "cooling_device%d", phy->mt76->band_idx); =20 - cdev =3D thermal_cooling_device_register(name, phy, &mt7996_thermal_ops); + cdev =3D thermal_cooling_device_register(&wiphy->dev, name, phy, &mt7996_= thermal_ops); if (!IS_ERR(cdev)) { if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj, cname) < 0) diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 5ce5ad3efe69..c74937d475e5 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c @@ -650,7 +650,7 @@ static int __init acerhdf_register_thermal(void) { int ret; =20 - cl_dev =3D thermal_cooling_device_register("acerhdf-fan", NULL, + cl_dev =3D thermal_cooling_device_register(NULL, "acerhdf-fan", NULL, &acerhdf_cooling_ops); =20 if (IS_ERR(cl_dev)) diff --git a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c b/driv= ers/thermal/intel/int340x_thermal/int3403_thermal.c index 264c9bc8e645..08d9e91f01cb 100644 --- a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c @@ -178,8 +178,8 @@ static int int3403_cdev_add(struct int3403_priv *priv) priv->priv =3D obj; obj->max_state =3D p->package.count - 1; obj->cdev =3D - thermal_cooling_device_register(acpi_device_bid(priv->adev), - priv, &int3403_cooling_ops); + thermal_cooling_device_register(&priv->adev->dev, acpi_device_bid(priv->= adev), + priv, &int3403_cooling_ops); if (IS_ERR(obj->cdev)) result =3D PTR_ERR(obj->cdev); =20 diff --git a/drivers/thermal/intel/int340x_thermal/int3406_thermal.c b/driv= ers/thermal/intel/int340x_thermal/int3406_thermal.c index e21fcbccf4ba..e458add39a88 100644 --- a/drivers/thermal/intel/int340x_thermal/int3406_thermal.c +++ b/drivers/thermal/intel/int340x_thermal/int3406_thermal.c @@ -157,7 +157,7 @@ static int int3406_thermal_probe(struct platform_device= *pdev) =20 int3406_thermal_get_limit(d); =20 - d->cooling_dev =3D thermal_cooling_device_register(acpi_device_bid(adev), + d->cooling_dev =3D thermal_cooling_device_register(&pdev->dev, acpi_devic= e_bid(adev), d, &video_cooling_ops); if (IS_ERR(d->cooling_dev)) goto err; diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/int= el/intel_powerclamp.c index 9a4cec000910..a8f798bf459f 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -779,7 +779,7 @@ static int __init powerclamp_init(void) /* set default limit, maybe adjusted during runtime based on feedback */ window_size =3D 2; =20 - cooling_dev =3D thermal_cooling_device_register("intel_powerclamp", NULL, + cooling_dev =3D thermal_cooling_device_register(NULL, "intel_powerclamp",= NULL, &powerclamp_cooling_ops); if (IS_ERR(cooling_dev)) return -ENODEV; diff --git a/drivers/thermal/intel/intel_tcc_cooling.c b/drivers/thermal/in= tel/intel_tcc_cooling.c index f352ecafbedf..a0ead0fb1fbe 100644 --- a/drivers/thermal/intel/intel_tcc_cooling.c +++ b/drivers/thermal/intel/intel_tcc_cooling.c @@ -101,7 +101,7 @@ static int __init tcc_cooling_init(void) pr_info("Programmable TCC Offset detected\n"); =20 tcc_cdev =3D - thermal_cooling_device_register("TCC Offset", NULL, + thermal_cooling_device_register(NULL, "TCC Offset", NULL, &tcc_cooling_ops); if (IS_ERR(tcc_cdev)) { ret =3D PTR_ERR(tcc_cdev); diff --git a/drivers/thermal/pcie_cooling.c b/drivers/thermal/pcie_cooling.c index a876d64f1582..4d37f7f9d108 100644 --- a/drivers/thermal/pcie_cooling.c +++ b/drivers/thermal/pcie_cooling.c @@ -61,7 +61,7 @@ struct thermal_cooling_device *pcie_cooling_device_regist= er(struct pci_dev *port if (!name) return ERR_PTR(-ENOMEM); =20 - return thermal_cooling_device_register(name, port, &pcie_cooling_ops); + return thermal_cooling_device_register(&port->dev, name, port, &pcie_cool= ing_ops); } =20 void pcie_cooling_device_unregister(struct thermal_cooling_device *cdev) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 5d752e712cc0..92e51d2e4535 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1145,6 +1145,7 @@ __thermal_cooling_device_register(struct device *pare= nt, struct device_node *np, =20 /** * thermal_cooling_device_register() - register a new thermal cooling devi= ce + * @parent: parent device pointer. * @type: the thermal cooling device type. * @devdata: device private data. * @ops: standard thermal cooling devices callbacks. @@ -1157,10 +1158,10 @@ __thermal_cooling_device_register(struct device *pa= rent, struct device_node *np, * ERR_PTR. Caller must check return value with IS_ERR*() helpers. */ struct thermal_cooling_device * -thermal_cooling_device_register(const char *type, void *devdata, +thermal_cooling_device_register(struct device *parent, const char *type, v= oid *devdata, const struct thermal_cooling_device_ops *ops) { - return __thermal_cooling_device_register(NULL, NULL, type, devdata, ops); + return __thermal_cooling_device_register(parent, NULL, type, devdata, ops= ); } EXPORT_SYMBOL_GPL(thermal_cooling_device_register); =20 diff --git a/include/linux/thermal.h b/include/linux/thermal.h index fa53d12173ce..29a608bf5f80 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -250,8 +250,9 @@ struct device *thermal_zone_device(struct thermal_zone_= device *tzd); void thermal_zone_device_update(struct thermal_zone_device *, enum thermal_notify_event); =20 -struct thermal_cooling_device *thermal_cooling_device_register(const char = *, - void *, const struct thermal_cooling_device_ops *); +struct thermal_cooling_device * +thermal_cooling_device_register(struct device *parent, const char *type, v= oid *drvdata, + const struct thermal_cooling_device_ops *ops); struct thermal_cooling_device * thermal_of_cooling_device_register(struct device *parent, struct device_no= de *np, const char *type, void *devdata, const struct thermal_cooling_device_ops *); @@ -298,8 +299,8 @@ static inline void thermal_zone_device_update(struct th= ermal_zone_device *tz, { } =20 static inline struct thermal_cooling_device * -thermal_cooling_device_register(const char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) +thermal_cooling_device_register(struct device *parent, const char *type, v= oid *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 *parent, struct device_no= de *np, const char *type, --=20 2.39.5