summaryrefslogtreecommitdiff
path: root/drivers/mtd/ofpart.c
diff options
context:
space:
mode:
authorIan Munsie <imunsie@au1.ibm.com>2010-10-01 11:06:08 +0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-10-25 03:55:56 +0400
commit766f271a63d1ee7caed8030736e6aed253d02073 (patch)
tree198b4cf3efd5de59121bdca483a095b8234b588a /drivers/mtd/ofpart.c
parentd86fbdb8ed0ac957693ff475cca076021677166a (diff)
downloadlinux-766f271a63d1ee7caed8030736e6aed253d02073.tar.xz
mtd: Fix endianness issues from device tree
This patch adds the appropriate conversions to correct the endianness issues in the MTD driver whenever it accesses the device tree (which is always big endian). Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/ofpart.c')
-rw-r--r--drivers/mtd/ofpart.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 8bf7dc6d1ce6..a996718fa6b0 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -44,7 +44,7 @@ int __devinit of_mtd_parse_partitions(struct device *dev,
pp = NULL;
i = 0;
while ((pp = of_get_next_child(node, pp))) {
- const u32 *reg;
+ const __be32 *reg;
int len;
reg = of_get_property(pp, "reg", &len);
@@ -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)