Skip to content

Commit

Permalink
of: MTD: Fix OF probing on little-endian systems
Browse files Browse the repository at this point in the history
Convert big-endian DTB to little-endian if necessary.

Signed-off-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Michal Simek authored and Grant Likely committed Sep 29, 2010
1 parent a04e78b commit 2548558
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/mtd/maps/physmap_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static int __devinit of_flash_probe(struct platform_device *dev,
info->list[i].map.name = dev_name(&dev->dev);
info->list[i].map.phys = res.start;
info->list[i].map.size = res_size;
info->list[i].map.bankwidth = *width;
info->list[i].map.bankwidth = be32_to_cpup(width);

err = -ENOMEM;
info->list[i].map.virt = ioremap(info->list[i].map.phys,
Expand Down
4 changes: 2 additions & 2 deletions drivers/mtd/ofpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
continue;
}

(*pparts)[i].offset = reg[0];
(*pparts)[i].size = reg[1];
(*pparts)[i].offset = be32_to_cpu(reg[0]);
(*pparts)[i].size = be32_to_cpu(reg[1]);

partname = of_get_property(pp, "label", &len);
if (!partname)
Expand Down

0 comments on commit 2548558

Please sign in to comment.