From a1b17e4f4c820c5ffe77ffa0c716e8b3b5d69866 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 10 Dec 2018 10:37:37 -0700 Subject: dm: core: Add a function to read into a unsigned int The current dev_read...() functions use s32 and u32 which are convenient for device tree but not so useful for normal code, which often wants to use normal integers for values. Add a helper which supports returning an unsigned int. Also add signed versions of the unsigned readers. Signed-off-by: Simon Glass --- arch/sandbox/dts/test.dts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/sandbox/dts') diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 82bd91936a..3790b4c520 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -87,6 +87,8 @@ test2-gpios = <&gpio_a 1>, <&gpio_a 4>, <&gpio_b 6 1 3 2 1>, <&gpio_b 7 2 3 2 1>, <&gpio_b 8 4 3 2 1>, <&gpio_b 9 0xc 3 2 1>; + int-value = <1234>; + uint-value = <(-1234)>; }; junk { -- cgit