diff options
Diffstat (limited to 'drivers/mtd/chips/cfi_util.c')
-rw-r--r-- | drivers/mtd/chips/cfi_util.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mtd/chips/cfi_util.c b/drivers/mtd/chips/cfi_util.c index 0cf183f01e49..d8e7a026ba5a 100644 --- a/drivers/mtd/chips/cfi_util.c +++ b/drivers/mtd/chips/cfi_util.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * This code is covered by the GPL. | 8 | * This code is covered by the GPL. |
9 | * | 9 | * |
10 | * $Id: cfi_util.c,v 1.9 2005/07/20 21:01:14 tpoynor Exp $ | 10 | * $Id: cfi_util.c,v 1.10 2005/11/07 11:14:23 gleixner Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -56,7 +56,7 @@ __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* n | |||
56 | 56 | ||
57 | /* Read in the Extended Query Table */ | 57 | /* Read in the Extended Query Table */ |
58 | for (i=0; i<size; i++) { | 58 | for (i=0; i<size; i++) { |
59 | ((unsigned char *)extp)[i] = | 59 | ((unsigned char *)extp)[i] = |
60 | cfi_read_query(map, base+((adr+i)*ofs_factor)); | 60 | cfi_read_query(map, base+((adr+i)*ofs_factor)); |
61 | } | 61 | } |
62 | 62 | ||
@@ -113,17 +113,17 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, | |||
113 | 113 | ||
114 | i = 0; | 114 | i = 0; |
115 | 115 | ||
116 | /* Skip all erase regions which are ended before the start of | 116 | /* Skip all erase regions which are ended before the start of |
117 | the requested erase. Actually, to save on the calculations, | 117 | the requested erase. Actually, to save on the calculations, |
118 | we skip to the first erase region which starts after the | 118 | we skip to the first erase region which starts after the |
119 | start of the requested erase, and then go back one. | 119 | start of the requested erase, and then go back one. |
120 | */ | 120 | */ |
121 | 121 | ||
122 | while (i < mtd->numeraseregions && ofs >= regions[i].offset) | 122 | while (i < mtd->numeraseregions && ofs >= regions[i].offset) |
123 | i++; | 123 | i++; |
124 | i--; | 124 | i--; |
125 | 125 | ||
126 | /* OK, now i is pointing at the erase region in which this | 126 | /* OK, now i is pointing at the erase region in which this |
127 | erase request starts. Check the start of the requested | 127 | erase request starts. Check the start of the requested |
128 | erase range is aligned with the erase size which is in | 128 | erase range is aligned with the erase size which is in |
129 | effect here. | 129 | effect here. |
@@ -146,7 +146,7 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, | |||
146 | the address actually falls | 146 | the address actually falls |
147 | */ | 147 | */ |
148 | i--; | 148 | i--; |
149 | 149 | ||
150 | if ((ofs + len) & (regions[i].erasesize-1)) | 150 | if ((ofs + len) & (regions[i].erasesize-1)) |
151 | return -EINVAL; | 151 | return -EINVAL; |
152 | 152 | ||
@@ -159,7 +159,7 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, | |||
159 | int size = regions[i].erasesize; | 159 | int size = regions[i].erasesize; |
160 | 160 | ||
161 | ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk); | 161 | ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk); |
162 | 162 | ||
163 | if (ret) | 163 | if (ret) |
164 | return ret; | 164 | return ret; |
165 | 165 | ||
@@ -173,7 +173,7 @@ int cfi_varsize_frob(struct mtd_info *mtd, varsize_frob_t frob, | |||
173 | if (adr >> cfi->chipshift) { | 173 | if (adr >> cfi->chipshift) { |
174 | adr = 0; | 174 | adr = 0; |
175 | chipnum++; | 175 | chipnum++; |
176 | 176 | ||
177 | if (chipnum >= cfi->numchips) | 177 | if (chipnum >= cfi->numchips) |
178 | break; | 178 | break; |
179 | } | 179 | } |