Add latest ia64 patches.
[linux-flexiantxendom0-3.2.10.git] / drivers / mtd / afs.c
index 6640ebc..527975d 100644 (file)
@@ -21,7 +21,7 @@
    This is access code for flashes using ARM's flash partitioning 
    standards.
 
-   $Id: afs.c,v 1.11 2003/05/16 17:08:24 dwmw2 Exp $
+   $Id: afs.c,v 1.12 2003/06/13 15:31:06 rmk Exp $
 
 ======================================================================*/
 
@@ -76,17 +76,19 @@ afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start,
                return ret;
        }
 
+       ret = 1;
+
        /*
         * Does it contain the magic number?
         */
        if (fs.signature != 0xa0ffff9f)
-               ret = 1;
+               ret = 0;
 
        /*
         * Don't touch the SIB.
         */
        if (fs.type == 2)
-               ret = 1;
+               ret = 0;
 
        *iis_start = fs.image_info_base & mask;
        *img_start = fs.image_start & mask;
@@ -96,14 +98,14 @@ afs_read_footer(struct mtd_info *mtd, u_int *img_start, u_int *iis_start,
         * be located after the footer structure.
         */
        if (*iis_start >= ptr)
-               ret = 1;
+               ret = 0;
 
        /*
         * Check the start of this image.  The image
         * data can not be located after this block.
         */
        if (*img_start > off)
-               ret = 1;
+               ret = 0;
 
        return ret;
 }
@@ -152,7 +154,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
                ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask);
                if (ret < 0)
                        break;
-               if (ret == 1)
+               if (ret == 0)
                        continue;
 
                ret = afs_read_iis(mtd, &iis, iis_ptr);
@@ -185,7 +187,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
                ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask);
                if (ret < 0)
                        break;
-               if (ret == 1)
+               if (ret == 0)
                        continue;
 
                /* Read the image info block */