[PATCH RFC RESEND 7/8] ACPI: thermal: Stop creating "device" sysfs link
Armin Wolf
W_Armin at gmx.de
Wed Nov 19 19:41:17 PST 2025
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 at gmx.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
More information about the linux-arm-kernel
mailing list