diff options
author | Ian Munsie <imunsie@au1.ibm.com> | 2010-10-01 17:06:08 +1000 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-25 00:55:56 +0100 |
commit | 766f271a63d1ee7caed8030736e6aed253d02073 (patch) | |
tree | 198b4cf3efd5de59121bdca483a095b8234b588a /drivers/mtd/ofpart.c | |
parent | d86fbdb8ed0ac957693ff475cca076021677166a (diff) |
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.c | 6 |
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) |