diff options
author | Michal Simek <monstr@monstr.eu> | 2010-09-29 01:52:13 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-09-29 02:28:14 -0400 |
commit | 2548558445b43c1f18a61c0bd3629f92dffa612e (patch) | |
tree | eabc0c5ea0d82f703225520a8545b5b4e341ced4 | |
parent | a04e78b8579272c37c42a9badb6dae71f38fe4a9 (diff) |
of: MTD: Fix OF probing on little-endian systems
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>
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 2 | ||||
-rw-r--r-- | drivers/mtd/ofpart.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index fe63f6bd663c..ec3edf6e68b4 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -294,7 +294,7 @@ static int __devinit of_flash_probe(struct platform_device *dev, | |||
294 | info->list[i].map.name = dev_name(&dev->dev); | 294 | info->list[i].map.name = dev_name(&dev->dev); |
295 | info->list[i].map.phys = res.start; | 295 | info->list[i].map.phys = res.start; |
296 | info->list[i].map.size = res_size; | 296 | info->list[i].map.size = res_size; |
297 | info->list[i].map.bankwidth = *width; | 297 | info->list[i].map.bankwidth = be32_to_cpup(width); |
298 | 298 | ||
299 | err = -ENOMEM; | 299 | err = -ENOMEM; |
300 | info->list[i].map.virt = ioremap(info->list[i].map.phys, | 300 | info->list[i].map.virt = ioremap(info->list[i].map.phys, |
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 8bf7dc6d1ce6..7bd171eefd21 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c | |||
@@ -53,8 +53,8 @@ int __devinit of_mtd_parse_partitions(struct device *dev, | |||
53 | continue; | 53 | continue; |
54 | } | 54 | } |
55 | 55 | ||
56 | (*pparts)[i].offset = reg[0]; | 56 | (*pparts)[i].offset = be32_to_cpu(reg[0]); |
57 | (*pparts)[i].size = reg[1]; | 57 | (*pparts)[i].size = be32_to_cpu(reg[1]); |
58 | 58 | ||
59 | partname = of_get_property(pp, "label", &len); | 59 | partname = of_get_property(pp, "label", &len); |
60 | if (!partname) | 60 | if (!partname) |