Re: [PATCH v1 01/14] thermal/of: Move OF code where it belongs to

sashiko-bot
2026-04-19T18:47:26Z

Sashiko AI review found 1 potential issue(s):
- [Low] Moving `[devm_]thermal_of_cooling_device_register()` to `thermal_of.c` causes undefined reference build errors on non-OF platforms.
--

commit 10b09a7422c3dc398ce39daac38970f758efdaee
Author: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>

thermal/of: Move OF code where it belongs to

This commit moves the OF-specific cooling device registration functions
from the thermal core to the thermal-of implementation.

> diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
> index 99085c806a1f6..398157e740fc7 100644
> --- a/drivers/thermal/thermal_of.c
> +++ b/drivers/thermal/thermal_of.c
[ ... ]
> +struct thermal_cooling_device *
> +devm_thermal_of_cooling_device_register(struct device *dev,
> + struct device_node *np,
> + const char *type, void *devdata,
> + const struct thermal_cooling_device_ops *ops)
> +{
> + struct thermal_cooling_device **ptr, *tcd;

Will moving these functions to thermal_of.c cause undefined reference
linker errors on non-OF platforms?

Several non-OF drivers, such as dell-smm-hwmon on x86, use these variants
unconditionally by passing a NULL pointer for the device tree node. Since
thermal_of.c is only compiled when CONFIG_THERMAL_OF is enabled, and the
headers do not provide dummy stubs for the disabled case, this move appears
to break the build for those platforms.

I see this is addressed later in the patch series by commits 18601ab408a18,
c24a43d962cbf, and 06c743d31c831. Could the dummy stubs or non-OF variants
be introduced before or during this move to prevent bisectability issues?

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260419182203.4083985-1-daniel.lezcano@oss.qualcomm.com?part=1