summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichal Simek2010-09-29 07:52:13 +0200
committerGrant Likely2010-09-29 08:28:14 +0200
commit2548558445b43c1f18a61c0bd3629f92dffa612e (patch)
treeeabc0c5ea0d82f703225520a8545b5b4e341ced4 /drivers
parentof: GPIO: Fix OF probing on little-endian systems (diff)
downloadkernel-qcow2-linux-2548558445b43c1f18a61c0bd3629f92dffa612e.tar.gz
kernel-qcow2-linux-2548558445b43c1f18a61c0bd3629f92dffa612e.tar.xz
kernel-qcow2-linux-2548558445b43c1f18a61c0bd3629f92dffa612e.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/maps/physmap_of.c2
-rw-r--r--drivers/mtd/ofpart.c4
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,
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,
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,
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)