fdt: call fdt_parent_offset fewer times while translating addresses
authorScott Wood <scottwood@freescale.com>
Thu, 12 Aug 2010 23:37:39 +0000 (18:37 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 20 Aug 2010 02:21:41 +0000 (21:21 -0500)
commit6395f318e9ddf26817a01f0b3877af0e3e47d056
tree5922044bd8856098212ff01d68763273b04d18b8
parentb80d30546e88c70985094d81297d449b2bc59033
fdt: call fdt_parent_offset fewer times while translating addresses

fdt_parent_offset() is an expensive operation, so we'd like to reduce
unnecessary calls to it.

Further, the practice of iterating up to the root if address/size cells
aren't found was apparently done for Linux for compatibility with certain
buggy Open Firmware implementations, and U-Boot inherited the code.  The
compliant behavior is to treat a missing #address-cells as 2, and a missing
#size-cells as 1 -- never looking anywhere but the immediate parent of the
node of interest.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
common/fdt_support.c