[PATCH RFC RESEND 4/8] ACPI: fan: Stop creating "device" sysfs link
Armin Wolf
W_Armin at gmx.de
Wed Nov 19 19:41:14 PST 2025
The thermal core will soon automatically create sysfs links between
the cooling device and its parent device. Stop manually creating
the "device" sysfs link between the cooling device and the parent
device to avoid a name collision. The "thermal_cooling" 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/fan_core.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/acpi/fan_core.c b/drivers/acpi/fan_core.c
index fb08b8549ed7..2ca3e347f15c 100644
--- a/drivers/acpi/fan_core.c
+++ b/drivers/acpi/fan_core.c
@@ -594,6 +594,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "registered as cooling_device%d\n", cdev->id);
fan->cdev = cdev;
+ /* For backwards compatibility */
result = sysfs_create_link(&pdev->dev.kobj,
&cdev->device.kobj,
"thermal_cooling");
@@ -602,18 +603,8 @@ static int acpi_fan_probe(struct platform_device *pdev)
goto err_unregister;
}
- result = sysfs_create_link(&cdev->device.kobj,
- &pdev->dev.kobj,
- "device");
- if (result) {
- dev_err(&pdev->dev, "Failed to create sysfs link 'device'\n");
- goto err_remove_link;
- }
-
return 0;
-err_remove_link:
- sysfs_remove_link(&pdev->dev.kobj, "thermal_cooling");
err_unregister:
thermal_cooling_device_unregister(cdev);
err_end:
@@ -633,7 +624,6 @@ static void acpi_fan_remove(struct platform_device *pdev)
acpi_fan_delete_attributes(device);
}
sysfs_remove_link(&pdev->dev.kobj, "thermal_cooling");
- sysfs_remove_link(&fan->cdev->device.kobj, "device");
thermal_cooling_device_unregister(fan->cdev);
}
--
2.39.5
More information about the linux-arm-kernel
mailing list