diff options
Diffstat (limited to 'drivers/mtd/maps/physmap_of.c')
-rw-r--r-- | drivers/mtd/maps/physmap_of.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index ec3edf6e68b4..9861814aa027 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c | |||
@@ -50,7 +50,7 @@ static int parse_obsolete_partitions(struct platform_device *dev, | |||
50 | { | 50 | { |
51 | int i, plen, nr_parts; | 51 | int i, plen, nr_parts; |
52 | const struct { | 52 | const struct { |
53 | u32 offset, len; | 53 | __be32 offset, len; |
54 | } *part; | 54 | } *part; |
55 | const char *names; | 55 | const char *names; |
56 | 56 | ||
@@ -69,9 +69,9 @@ static int parse_obsolete_partitions(struct platform_device *dev, | |||
69 | names = of_get_property(dp, "partition-names", &plen); | 69 | names = of_get_property(dp, "partition-names", &plen); |
70 | 70 | ||
71 | for (i = 0; i < nr_parts; i++) { | 71 | for (i = 0; i < nr_parts; i++) { |
72 | info->parts[i].offset = part->offset; | 72 | info->parts[i].offset = be32_to_cpu(part->offset); |
73 | info->parts[i].size = part->len & ~1; | 73 | info->parts[i].size = be32_to_cpu(part->len) & ~1; |
74 | if (part->len & 1) /* bit 0 set signifies read only partition */ | 74 | if (be32_to_cpu(part->len) & 1) /* bit 0 set signifies read only partition */ |
75 | info->parts[i].mask_flags = MTD_WRITEABLE; | 75 | info->parts[i].mask_flags = MTD_WRITEABLE; |
76 | 76 | ||
77 | if (names && (plen > 0)) { | 77 | if (names && (plen > 0)) { |
@@ -226,11 +226,11 @@ static int __devinit of_flash_probe(struct platform_device *dev, | |||
226 | struct resource res; | 226 | struct resource res; |
227 | struct of_flash *info; | 227 | struct of_flash *info; |
228 | const char *probe_type = match->data; | 228 | const char *probe_type = match->data; |
229 | const u32 *width; | 229 | const __be32 *width; |
230 | int err; | 230 | int err; |
231 | int i; | 231 | int i; |
232 | int count; | 232 | int count; |
233 | const u32 *p; | 233 | const __be32 *p; |
234 | int reg_tuple_size; | 234 | int reg_tuple_size; |
235 | struct mtd_info **mtd_list = NULL; | 235 | struct mtd_info **mtd_list = NULL; |
236 | resource_size_t res_size; | 236 | resource_size_t res_size; |
@@ -267,9 +267,11 @@ static int __devinit of_flash_probe(struct platform_device *dev, | |||
267 | for (i = 0; i < count; i++) { | 267 | for (i = 0; i < count; i++) { |
268 | err = -ENXIO; | 268 | err = -ENXIO; |
269 | if (of_address_to_resource(dp, i, &res)) { | 269 | if (of_address_to_resource(dp, i, &res)) { |
270 | dev_err(&dev->dev, "Can't get IO address from device" | 270 | /* |
271 | " tree\n"); | 271 | * Continue with next register tuple if this |
272 | goto err_out; | 272 | * one is not mappable |
273 | */ | ||
274 | continue; | ||
273 | } | 275 | } |
274 | 276 | ||
275 | dev_dbg(&dev->dev, "of_flash device: %.8llx-%.8llx\n", | 277 | dev_dbg(&dev->dev, "of_flash device: %.8llx-%.8llx\n", |