]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: physmap_of: Loop through all "reg" tuples for mapping
authorStefan Roese <sr@denx.de>
Fri, 8 Oct 2010 12:41:27 +0000 (14:41 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 25 Oct 2010 00:12:46 +0000 (01:12 +0100)
commit589d7aba7abb58e95177c9528a993312e52c52bf
tree9d913b4f995410927058b5ce70a5d0e088ff3c16
parentd214a9e90dce2da98fa050a55a5d7fa9d23bf221
mtd: physmap_of: Loop through all "reg" tuples for mapping

This patch changes the loop over the "reg" tuples to not exit
directly upon of_address_to_resource() failure but to continue
with the next "reg" tuple instead. This failure could be due to
size = 0, which might be passed via the device-tree.

This is needed for boards, where a "reg" tuple might have size 0
(of_address_to_resource() returns with EINVAL when size = 0).

Example:

Fully equipped board:

reg = <0 0x00000000 0x00400000
       0 0x00400000 0x00400000>;

Partially equipped board:

reg = <0 0x00000000 0x00400000
       0 0x00400000 0x00000000>;

This could be the case on boards with runtime detection of
multiple NOR flash configurations where the detected flash size
is inserted into the dtb in U-Boot.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/maps/physmap_of.c