summaryrefslogtreecommitdiffstats
path: root/include/dt-bindings
diff options
context:
space:
mode:
authorPunit Agrawal <punit.agrawal@arm.com>2014-12-09 12:22:01 +0000
committerEduardo Valentin <edubezval@gmail.com>2014-12-10 11:11:00 -0400
commita940cb34fed73b2d4809a4575f2981d5927e2c21 (patch)
tree79e734bca7507b5e83e781fa48c265cd34cfe847 /include/dt-bindings
parentfcbb1e02ee540e1875137d36259017f91b95c30c (diff)
downloadop-kernel-dev-a940cb34fed73b2d4809a4575f2981d5927e2c21.zip
op-kernel-dev-a940cb34fed73b2d4809a4575f2981d5927e2c21.tar.gz
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: Hyungwoo Yang <hwoo.yang@gmail.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'include/dt-bindings')
-rw-r--r--include/dt-bindings/thermal/thermal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/dt-bindings/thermal/thermal.h b/include/dt-bindings/thermal/thermal.h
index 59822a9..b5e6b00 100644
--- a/include/dt-bindings/thermal/thermal.h
+++ b/include/dt-bindings/thermal/thermal.h
@@ -11,7 +11,7 @@
#define _DT_BINDINGS_THERMAL_THERMAL_H
/* On cooling devices upper and lower limits */
-#define THERMAL_NO_LIMIT (-1UL)
+#define THERMAL_NO_LIMIT (~0)
#endif
OpenPOWER on IntegriCloud