[PATCH] mtd: physmap_of: Loop through all "reg" tuples for mapping

Artem Bityutskiy dedekind1 at gmail.com
Tue Oct 12 04:55:03 EDT 2010


On Fri, 2010-10-08 at 14:41 +0200, Stefan Roese wrote:
> 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 at denx.de>
> ---
>  drivers/mtd/maps/physmap_of.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)

Pushed to l2-mtd-2.6.git, thanks!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list