diff options
author | Ian Munsie <imunsie@au1.ibm.com> | 2010-10-01 03:06:08 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-24 19:55:56 -0400 |
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 8bf7dc6d1ce..a996718fa6b 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c | |||
@@ -44,7 +44,7 @@ int __devinit of_mtd_parse_partitions(struct device *dev, | |||
44 | pp = NULL; | 44 | pp = NULL; |
45 | i = 0; | 45 | i = 0; |
46 | while ((pp = of_get_next_child(node, pp))) { | 46 | while ((pp = of_get_next_child(node, pp))) { |
47 | const u32 *reg; | 47 | const __be32 *reg; |
48 | int len; | 48 | int len; |
49 | 49 | ||
50 | reg = of_get_property(pp, "reg", &len); | 50 | reg = of_get_property(pp, "reg", &len); |
@@ -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) |