diff mbox series

dt-bindings: hwmon: (adc128d818) Specify ti,mode property size

Message ID 20190313141125.GA26062@carlosaurelio.net (mailing list archive)
State Accepted
Headers show
Series dt-bindings: hwmon: (adc128d818) Specify ti,mode property size | expand

Commit Message

Carlos Menin March 13, 2019, 2:11 p.m. UTC
By default, cells in DT are 32-bit in size. The driver reads "ti,mode"
using the function of_property_read_u8() which causes the value to be
read incorrectly in little-endian architectures if the size is not
specified.

Make it explicit in the binding documentation that this prorperty must
be set as a 8-bit value.

Signed-off-by: Carlos Menin <menin@carlosaurelio.net>
---
 Documentation/devicetree/bindings/hwmon/adc128d818.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rob Herring (Arm) March 28, 2019, 3:19 p.m. UTC | #1
On Wed, 13 Mar 2019 11:11:26 -0300, Carlos Menin wrote:
> By default, cells in DT are 32-bit in size. The driver reads "ti,mode"
> using the function of_property_read_u8() which causes the value to be
> read incorrectly in little-endian architectures if the size is not
> specified.
> 
> Make it explicit in the binding documentation that this prorperty must
> be set as a 8-bit value.
> 
> Signed-off-by: Carlos Menin <menin@carlosaurelio.net>
> ---
>  Documentation/devicetree/bindings/hwmon/adc128d818.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Guenter Roeck March 29, 2019, 4:52 p.m. UTC | #2
On Wed, Mar 13, 2019 at 11:11:26AM -0300, Carlos Menin wrote:
> By default, cells in DT are 32-bit in size. The driver reads "ti,mode"
> using the function of_property_read_u8() which causes the value to be
> read incorrectly in little-endian architectures if the size is not
> specified.
> 
> Make it explicit in the binding documentation that this prorperty must
> be set as a 8-bit value.
> 
> Signed-off-by: Carlos Menin <menin@carlosaurelio.net>
> Reviewed-by: Rob Herring <robh@kernel.org>

Applied.

Thanks,
Guenter

> ---
>  Documentation/devicetree/bindings/hwmon/adc128d818.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/adc128d818.txt b/Documentation/devicetree/bindings/hwmon/adc128d818.txt
> index 08bab0e..d0ae46d 100644
> --- a/Documentation/devicetree/bindings/hwmon/adc128d818.txt
> +++ b/Documentation/devicetree/bindings/hwmon/adc128d818.txt
> @@ -26,7 +26,7 @@ Required node properties:
>  
>  Optional node properties:
>  
> - - ti,mode:     Operation mode (see above).
> + - ti,mode:     Operation mode (u8) (see above).
>  
>  
>  Example (operation mode 2):
> @@ -34,5 +34,5 @@ Example (operation mode 2):
>  	adc128d818@1d {
>  		compatible = "ti,adc128d818";
>  		reg = <0x1d>;
> -		ti,mode = <2>;
> +		ti,mode = /bits/ 8 <2>;
>  	};
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/adc128d818.txt b/Documentation/devicetree/bindings/hwmon/adc128d818.txt
index 08bab0e..d0ae46d 100644
--- a/Documentation/devicetree/bindings/hwmon/adc128d818.txt
+++ b/Documentation/devicetree/bindings/hwmon/adc128d818.txt
@@ -26,7 +26,7 @@  Required node properties:
 
 Optional node properties:
 
- - ti,mode:     Operation mode (see above).
+ - ti,mode:     Operation mode (u8) (see above).
 
 
 Example (operation mode 2):
@@ -34,5 +34,5 @@  Example (operation mode 2):
 	adc128d818@1d {
 		compatible = "ti,adc128d818";
 		reg = <0x1d>;
-		ti,mode = <2>;
+		ti,mode = /bits/ 8 <2>;
 	};