Skip to content
Commit a940cb34 authored by Punit Agrawal's avatar Punit Agrawal Committed by Eduardo Valentin
Browse files

thermal: Fix cdev registration with THERMAL_NO_LIMIT on 64bit



The size of unsigned long varies between 32 and 64 bit systems while
the size of phandle arguments is always 32 bits per parameter.

On 64-bit systems, cooling devices registered via of-thermal apis fail
to bind when the min/max cooling state is specified as
THERMAL_NO_LIMIT (-1UL) as there is a mis-match between the value read
from the device tree (32bit) and the pre-processor define (64bit).

As we're unlikely to need cooling states larger than 32 bits, and for
consistency with the size of phandle arguments, explicitly limit
THERMAL_NO_LIMIT to 32 bits.

Reported-by: default avatarHyungwoo Yang <hwoo.yang@gmail.com>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarPunit Agrawal <punit.agrawal@arm.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent fcbb1e02
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment