lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251120-thermal-device-v1-7-bbdad594d57a@gmx.de>
Date: Thu, 20 Nov 2025 04:41:17 +0100
From: Armin Wolf <W_Armin@....de>
To: "Rafael J. Wysocki" <rafael@...nel.org>, 
 Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>, 
 Lukasz Luba <lukasz.luba@....com>, Len Brown <lenb@...nel.org>, 
 Jonathan Corbet <corbet@....net>, Ido Schimmel <idosch@...dia.com>, 
 Petr Machata <petrm@...dia.com>
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org, 
 etnaviv@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org, 
 linux-tegra@...r.kernel.org, linux-acpi@...r.kernel.org, 
 linux-doc@...r.kernel.org, netdev@...r.kernel.org, 
 linux-wireless@...r.kernel.org, ath10k@...ts.infradead.org, 
 ath11k@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org, 
 linux-mediatek@...ts.infradead.org, platform-driver-x86@...r.kernel.org, 
 linux-pci@...r.kernel.org, imx@...ts.linux.dev, 
 linux-renesas-soc@...r.kernel.org
Subject: [PATCH RFC RESEND 7/8] ACPI: thermal: Stop creating "device" sysfs
 link

The thermal core will soon automatically create sysfs links between
the thermal zone device and its parent device. Stop manually creating
the "device" sysfs link between the thermal zone device and the parent
device to avoid a name collision. The "thermal_zone" sysfs link
however stays for backwards compatibility, as it does not suffer
from a name collision.

Signed-off-by: Armin Wolf <W_Armin@....de>
---
 drivers/acpi/thermal.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index a511f9ea0267..99ad67bbd764 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -592,27 +592,14 @@ static const struct thermal_zone_device_ops acpi_thermal_zone_ops = {
 static int acpi_thermal_zone_sysfs_add(struct acpi_thermal *tz)
 {
 	struct device *tzdev = thermal_zone_device(tz->thermal_zone);
-	int ret;
 
-	ret = sysfs_create_link(&tz->device->dev.kobj,
-				&tzdev->kobj, "thermal_zone");
-	if (ret)
-		return ret;
-
-	ret = sysfs_create_link(&tzdev->kobj,
-				   &tz->device->dev.kobj, "device");
-	if (ret)
-		sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
-
-	return ret;
+	/* For backwards compatibility */
+	return sysfs_create_link(&tz->device->dev.kobj, &tzdev->kobj, "thermal_zone");
 }
 
 static void acpi_thermal_zone_sysfs_remove(struct acpi_thermal *tz)
 {
-	struct device *tzdev = thermal_zone_device(tz->thermal_zone);
-
 	sysfs_remove_link(&tz->device->dev.kobj, "thermal_zone");
-	sysfs_remove_link(&tzdev->kobj, "device");
 }
 
 static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz,

-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ