Subject: Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor

From: Daniel Baluta <[email-masked]>
Date: Tue, 24 Mar 2026 12:00:39 +0200

On 3/24/26 11:26, Krzysztof Kozlowski wrote:
> On Mon, Mar 23, 2026 at 07:08:09PM +0530, Gopi Krishna Menon wrote:
>> Running DTBS checks on st/spear1340-evb.dtb results in the following
>> warning:
>>
>> thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('thermal_flags' was unexpected)
>>   from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yaml
> How is it possible if there is no such file?
>
> Did you just add new warning in patch #1 and then claim in patch #2 that
> you fix it?
>
> You completely miss the point why this change is needed: how could the
> DTS work before? It could not. And that should be your justification for
> the patch, with explanation why it could not work.

Correct me if I'm wrong but I think there was a hidden bug here 

drivers/thermal/spear_thermal.c:spear_thermal_probe:

      if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
»       »       dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");                                                                                                                         
»       »       return -EINVAL;
»       }

So, the driver was checking for the correct property as pointed by 

bindings/thermal/spear-thermal.txt but the dts was using the wrong

property name: arch/arm/boot/dts/st/spear13xx.dtsi » » » thermal@e07008c4 { » » » » compatible = "st,thermal-spear1340"; » » » » reg = <0xe07008c4 0x4>; » » » » thermal_flags = <0x7000>; » » » }; And because this check is wrong:

      if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {

people really didn't notice it.

The check should be:

      if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) {
»       »       dev_err(&pdev->dev, "Failed: DT Pdata not passed\n");                                                                                                                         
»       »       return -EINVAL;
»       }

So, this actual patch has uncovered a bug!