]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/mtd/maps/physmap_of.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / mtd / maps / physmap_of.c
index fe63f6bd663c1f7a5ac8db57a0014c1c4a019da0..8506578e6a352084b37593492e13751f60eb4925 100644 (file)
@@ -50,7 +50,7 @@ static int parse_obsolete_partitions(struct platform_device *dev,
 {
        int i, plen, nr_parts;
        const struct {
-               u32 offset, len;
+               __be32 offset, len;
        } *part;
        const char *names;
 
@@ -69,9 +69,9 @@ static int parse_obsolete_partitions(struct platform_device *dev,
        names = of_get_property(dp, "partition-names", &plen);
 
        for (i = 0; i < nr_parts; i++) {
-               info->parts[i].offset = part->offset;
-               info->parts[i].size   = part->len & ~1;
-               if (part->len & 1) /* bit 0 set signifies read only partition */
+               info->parts[i].offset = be32_to_cpu(part->offset);
+               info->parts[i].size   = be32_to_cpu(part->len) & ~1;
+               if (be32_to_cpu(part->len) & 1) /* bit 0 set signifies read only partition */
                        info->parts[i].mask_flags = MTD_WRITEABLE;
 
                if (names && (plen > 0)) {
@@ -226,11 +226,11 @@ static int __devinit of_flash_probe(struct platform_device *dev,
        struct resource res;
        struct of_flash *info;
        const char *probe_type = match->data;
-       const u32 *width;
+       const __be32 *width;
        int err;
        int i;
        int count;
-       const u32 *p;
+       const __be32 *p;
        int reg_tuple_size;
        struct mtd_info **mtd_list = NULL;
        resource_size_t res_size;
@@ -267,14 +267,14 @@ static int __devinit of_flash_probe(struct platform_device *dev,
        for (i = 0; i < count; i++) {
                err = -ENXIO;
                if (of_address_to_resource(dp, i, &res)) {
-                       dev_err(&dev->dev, "Can't get IO address from device"
-                               " tree\n");
-                       goto err_out;
+                       /*
+                        * Continue with next register tuple if this
+                        * one is not mappable
+                        */
+                       continue;
                }
 
-               dev_dbg(&dev->dev, "of_flash device: %.8llx-%.8llx\n",
-                       (unsigned long long)res.start,
-                       (unsigned long long)res.end);
+               dev_dbg(&dev->dev, "of_flash device: %pR\n", &res);
 
                err = -EBUSY;
                res_size = resource_size(&res);
@@ -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,