bump ifxmips to .30
[openwrt/openwrt.git] / target / linux / ifxmips / files / drivers / mtd / maps / ifxmips.c
index aed241b983f320060e2b9f4ae5bb3a812d382fdf..6498d12cb1511f7969fda5aa5db9528743d2cbab 100644 (file)
 #include <linux/mtd/map.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/cfi.h>
+#include <linux/magic.h>
+#include <linux/platform_device.h>
+
 #include <asm/ifxmips/ifxmips.h>
 #include <asm/ifxmips/ifxmips_prom.h>
 #include <asm/ifxmips/ifxmips_ebu.h>
-#include <linux/magic.h>
-#include <linux/platform_device.h>
 
 #ifndef CONFIG_MTD_PARTITIONS
 #error Please enable CONFIG_MTD_PARTITIONS
@@ -133,8 +134,8 @@ int find_uImage_size(unsigned long start_offset)
        unsigned long magic;
        unsigned long temp;
        ifxmips_copy_from(&ifxmips_map, &magic, start_offset, 4);
-       if (!(ntohl(magic) == 0x27051956)) {
-               printk(KERN_INFO "ifxmips_mtd: invalid magic (0x%08X) of kernel at 0x%08lx \n", ntohl(magic), start_offset);
+       if (le32_to_cpu(magic) != 0x56190527) {
+               printk(KERN_INFO "ifxmips_mtd: invalid magic (0x%08X) of kernel at 0x%08lx \n", le32_to_cpu(magic), start_offset);
                return 0;
        }
        ifxmips_copy_from(&ifxmips_map, &temp, start_offset + 12, 4);
@@ -158,7 +159,7 @@ int detect_squashfs_partition(unsigned long start_offset)
 {
        unsigned long temp;
        ifxmips_copy_from(&ifxmips_map, &temp, start_offset, 4);
-       return temp == SQUASHFS_MAGIC;
+       return le32_to_cpu(temp) == SQUASHFS_MAGIC;
 }
 
 static int ifxmips_mtd_probe(struct platform_device *dev)
@@ -231,9 +232,9 @@ static int ifxmips_mtd_probe(struct platform_device *dev)
 
        if (err <= 0) {
                if (ifxmips_has_brn_block()) {
-                       parts[4].size -= ifxmips_mtd->erasesize;
-                       parts[5].offset = ifxmips_mtd->size - ifxmips_mtd->erasesize;
-                       parts[5].size = ifxmips_mtd->erasesize;
+                       parts[3].size -= ifxmips_mtd->erasesize;
+                       parts[4].offset = ifxmips_mtd->size - ifxmips_mtd->erasesize;
+                       parts[4].size = ifxmips_mtd->erasesize;
                } else {
                        num_parts--;
                }