Przemyslaw Marczak ff0a6358b6 fdtdec: fix parsing 'reg' property with zero value in '#size-cells'
After rework of lib/fdtdec.c by:

commit: 02464e3 fdt: add new fdt address parsing functions

the function fdtdec_get_addr() doesn't work as previous,
because the implementation assumes that properties '#address-cells'
and '#size-cells' are equal to 1, which can be not true sometimes.

The new API introduced fdtdec_get_addr_size_auto_parent() for the 'reg'
property parsing, but the implementation assumes, that #size-cells
can't be less than 1.

This causes that the following children's 'reg' property can't be reached:

parent@0x0 {
     #address-cells = <1>;
     #size-cells = <0>;
     children@0x100 {
         reg = < 0x100 >;
     };
};

Change the condition value from '1' to '0', which allows parsing property
with at least zero #size-cells, fixes the issue.

Now, fdtdec_get_addr_size_auto_parent() works properly.

Tested on: Odroid U3/X2, Trats, Trats2, Odroid XU3, Snow (by Simon).

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2015-10-03 14:39:19 +01:00
..
2015-01-14 11:35:44 -05:00
2015-07-21 17:39:19 -06:00
2015-01-14 11:35:44 -05:00
2011-01-18 23:38:08 +01:00
2014-01-08 17:20:34 -07:00
2014-07-18 17:53:22 -04:00
2010-09-19 19:29:47 +02:00
2015-08-31 07:57:27 -06:00
2014-10-25 07:02:01 -04:00
2012-04-29 14:14:08 +02:00
2015-07-21 17:39:28 -06:00
2014-07-18 17:53:23 -04:00
2014-10-27 11:04:01 -04:00