X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fchips%2Fcfi_util.c;h=d8e7a026ba5ae945a83da21485f4a34dac71ef2d;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=2b2ede2bfccaeca3f9e0e47f2869d501b1633abf;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index 2b2ede2bf..d8e7a026b 100644 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c @@ -7,7 +7,7 @@ * * This code is covered by the GPL. * - * $Id: cfi_util.c,v 1.8 2004/12/14 19:55:56 nico Exp $ + * $Id: cfi_util.c,v 1.10 2005/11/07 11:14:23 gleixner Exp $ * */ @@ -56,7 +56,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n /* Read in the Extended Query Table */ for (i=0; iMajorVersion != '1' || - (extp->MinorVersion < '0' || extp->MinorVersion > '3')) { - printk(KERN_WARNING " Unknown %s Extended Query " - "version %c.%c.\n", name, extp->MajorVersion, - extp->MinorVersion); - kfree(extp); - extp = NULL; - } - out: return extp; } @@ -122,17 +113,17 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, i = 0; - /* Skip all erase regions which are ended before the start of + /* Skip all erase regions which are ended before the start of the requested erase. Actually, to save on the calculations, we skip to the first erase region which starts after the start of the requested erase, and then go back one. */ - + while (i < mtd->numeraseregions && ofs >= regions[i].offset) i++; i--; - /* OK, now i is pointing at the erase region in which this + /* OK, now i is pointing at the erase region in which this erase request starts. Check the start of the requested erase range is aligned with the erase size which is in effect here. @@ -155,7 +146,7 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, the address actually falls */ i--; - + if ((ofs + len) & (regions[i].erasesize-1)) return -EINVAL; @@ -168,7 +159,7 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, int size = regions[i].erasesize; ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk); - + if (ret) return ret; @@ -182,7 +173,7 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, if (adr >> cfi->chipshift) { adr = 0; chipnum++; - + if (chipnum >= cfi->numchips) break; }