Re: [PATCH v1 04/10] ACPI: processor: thermal: Use thermal_cooling_device_create()

From: Andy Shevchenko

Date: Fri Sep 11 2026 - 13:06:03 EST


On Fri, Sep 11, 2026 at 03:02:53PM +0200, Rafael J. Wysocki wrote:

> Instead of using thermal_cooling_device_register() for registering
> a cooling device in the ACPI processor driver, make it use
> thermal_cooling_device_create() and pass a pointer to the processor
> device representing the given CPU to that function as the cooling
> device's parent. That will cause the cooling device's sysfs directory
> to be created under the parent's sysfs directory (among other things).
>
> Since creating a class device under a parent causes a "device" symbolic
> link from the sysfs directory of the class device to the sysfs directory
> of the parent to appear automatically, remove the code creating the
> "device" symbolic link from the sysfs directory of the cooling device
> in question to the sysfs directory of the parent's companion ACPI
> device. That ACPI device is reachable through the "firmware_node"
> symbolic link in the parent's sysfs directory regardless.
>
> Moreover, since the cooling device is now located in sysfs under its
> parent and it can be easily identified as a cooling device, there is
> no need to create a "thermal_cooling" symbolic link from its parent's
> ACPI companion to it. Accordingly, also remove the code creating that
> symbolic link.
>
> While at it, check for error pointer values in addition to checking
> for NULL in acpi_processor_thermal_exit() to avoid dereferncing them

Typo: dereferencing

> mistakenly.

...

Is any user space ABI breakage expected as an outcome of this change?

--
With Best Regards,
Andy Shevchenko