aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtdblock.c')
-rw-r--r--drivers/mtd/mtdblock.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mtd/mtdblock.c b/drivers/mtd/mtdblock.c
index 8e50170137e0..9b0bc20e4d8d 100644
--- a/drivers/mtd/mtdblock.c
+++ b/drivers/mtd/mtdblock.c
@@ -71,7 +71,7 @@ static int erase_write (struct mtd_info *mtd, unsigned long pos,
71 set_current_state(TASK_INTERRUPTIBLE); 71 set_current_state(TASK_INTERRUPTIBLE);
72 add_wait_queue(&wait_q, &wait); 72 add_wait_queue(&wait_q, &wait);
73 73
74 ret = MTD_ERASE(mtd, &erase); 74 ret = mtd->erase(mtd, &erase);
75 if (ret) { 75 if (ret) {
76 set_current_state(TASK_RUNNING); 76 set_current_state(TASK_RUNNING);
77 remove_wait_queue(&wait_q, &wait); 77 remove_wait_queue(&wait_q, &wait);
@@ -88,7 +88,7 @@ static int erase_write (struct mtd_info *mtd, unsigned long pos,
88 * Next, writhe data to flash. 88 * Next, writhe data to flash.
89 */ 89 */
90 90
91 ret = MTD_WRITE (mtd, pos, len, &retlen, buf); 91 ret = mtd->write(mtd, pos, len, &retlen, buf);
92 if (ret) 92 if (ret)
93 return ret; 93 return ret;
94 if (retlen != len) 94 if (retlen != len)
@@ -138,7 +138,7 @@ static int do_cached_write (struct mtdblk_dev *mtdblk, unsigned long pos,
138 mtd->name, pos, len); 138 mtd->name, pos, len);
139 139
140 if (!sect_size) 140 if (!sect_size)
141 return MTD_WRITE (mtd, pos, len, &retlen, buf); 141 return mtd->write(mtd, pos, len, &retlen, buf);
142 142
143 while (len > 0) { 143 while (len > 0) {
144 unsigned long sect_start = (pos/sect_size)*sect_size; 144 unsigned long sect_start = (pos/sect_size)*sect_size;
@@ -170,7 +170,8 @@ static int do_cached_write (struct mtdblk_dev *mtdblk, unsigned long pos,
170 mtdblk->cache_offset != sect_start) { 170 mtdblk->cache_offset != sect_start) {
171 /* fill the cache with the current sector */ 171 /* fill the cache with the current sector */
172 mtdblk->cache_state = STATE_EMPTY; 172 mtdblk->cache_state = STATE_EMPTY;
173 ret = MTD_READ(mtd, sect_start, sect_size, &retlen, mtdblk->cache_data); 173 ret = mtd->read(mtd, sect_start, sect_size,
174 &retlen, mtdblk->cache_data);
174 if (ret) 175 if (ret)
175 return ret; 176 return ret;
176 if (retlen != sect_size) 177 if (retlen != sect_size)
@@ -207,7 +208,7 @@ static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos,
207 mtd->name, pos, len); 208 mtd->name, pos, len);
208 209
209 if (!sect_size) 210 if (!sect_size)
210 return MTD_READ (mtd, pos, len, &retlen, buf); 211 return mtd->read(mtd, pos, len, &retlen, buf);
211 212
212 while (len > 0) { 213 while (len > 0) {
213 unsigned long sect_start = (pos/sect_size)*sect_size; 214 unsigned long sect_start = (pos/sect_size)*sect_size;
@@ -226,7 +227,7 @@ static int do_cached_read (struct mtdblk_dev *mtdblk, unsigned long pos,
226 mtdblk->cache_offset == sect_start) { 227 mtdblk->cache_offset == sect_start) {
227 memcpy (buf, mtdblk->cache_data + offset, size); 228 memcpy (buf, mtdblk->cache_data + offset, size);
228 } else { 229 } else {
229 ret = MTD_READ (mtd, pos, size, &retlen, buf); 230 ret = mtd->read(mtd, pos, size, &retlen, buf);
230 if (ret) 231 if (ret)
231 return ret; 232 return ret;
232 if (retlen != size) 233 if (retlen != size)