diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:35:41 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:20 -0500 |
commit | eda95cbf75193808f62948fb0142ba0901d8bee2 (patch) | |
tree | 047bcfa05bc118b1d34327b3e62fa1d10d4bcb43 /drivers/mtd/tests | |
parent | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (diff) |
mtd: introduce mtd_write interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r-- | drivers/mtd/tests/mtd_pagetest.c | 8 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_speedtest.c | 8 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_stresstest.c | 2 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_subpagetest.c | 6 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_torturetest.c | 2 |
5 files changed, 13 insertions, 13 deletions
diff --git a/drivers/mtd/tests/mtd_pagetest.c b/drivers/mtd/tests/mtd_pagetest.c index 6d62e24a03ed..83da97e54f97 100644 --- a/drivers/mtd/tests/mtd_pagetest.c +++ b/drivers/mtd/tests/mtd_pagetest.c | |||
@@ -100,7 +100,7 @@ static int write_eraseblock(int ebnum) | |||
100 | 100 | ||
101 | set_random_data(writebuf, mtd->erasesize); | 101 | set_random_data(writebuf, mtd->erasesize); |
102 | cond_resched(); | 102 | cond_resched(); |
103 | err = mtd->write(mtd, addr, mtd->erasesize, &written, writebuf); | 103 | err = mtd_write(mtd, addr, mtd->erasesize, &written, writebuf); |
104 | if (err || written != mtd->erasesize) | 104 | if (err || written != mtd->erasesize) |
105 | printk(PRINT_PREF "error: write failed at %#llx\n", | 105 | printk(PRINT_PREF "error: write failed at %#llx\n", |
106 | (long long)addr); | 106 | (long long)addr); |
@@ -335,7 +335,7 @@ static int erasecrosstest(void) | |||
335 | printk(PRINT_PREF "writing 1st page of block %d\n", ebnum); | 335 | printk(PRINT_PREF "writing 1st page of block %d\n", ebnum); |
336 | set_random_data(writebuf, pgsize); | 336 | set_random_data(writebuf, pgsize); |
337 | strcpy(writebuf, "There is no data like this!"); | 337 | strcpy(writebuf, "There is no data like this!"); |
338 | err = mtd->write(mtd, addr0, pgsize, &written, writebuf); | 338 | err = mtd_write(mtd, addr0, pgsize, &written, writebuf); |
339 | if (err || written != pgsize) { | 339 | if (err || written != pgsize) { |
340 | printk(PRINT_PREF "error: write failed at %#llx\n", | 340 | printk(PRINT_PREF "error: write failed at %#llx\n", |
341 | (long long)addr0); | 341 | (long long)addr0); |
@@ -368,7 +368,7 @@ static int erasecrosstest(void) | |||
368 | printk(PRINT_PREF "writing 1st page of block %d\n", ebnum); | 368 | printk(PRINT_PREF "writing 1st page of block %d\n", ebnum); |
369 | set_random_data(writebuf, pgsize); | 369 | set_random_data(writebuf, pgsize); |
370 | strcpy(writebuf, "There is no data like this!"); | 370 | strcpy(writebuf, "There is no data like this!"); |
371 | err = mtd->write(mtd, addr0, pgsize, &written, writebuf); | 371 | err = mtd_write(mtd, addr0, pgsize, &written, writebuf); |
372 | if (err || written != pgsize) { | 372 | if (err || written != pgsize) { |
373 | printk(PRINT_PREF "error: write failed at %#llx\n", | 373 | printk(PRINT_PREF "error: write failed at %#llx\n", |
374 | (long long)addr0); | 374 | (long long)addr0); |
@@ -425,7 +425,7 @@ static int erasetest(void) | |||
425 | 425 | ||
426 | printk(PRINT_PREF "writing 1st page of block %d\n", ebnum); | 426 | printk(PRINT_PREF "writing 1st page of block %d\n", ebnum); |
427 | set_random_data(writebuf, pgsize); | 427 | set_random_data(writebuf, pgsize); |
428 | err = mtd->write(mtd, addr0, pgsize, &written, writebuf); | 428 | err = mtd_write(mtd, addr0, pgsize, &written, writebuf); |
429 | if (err || written != pgsize) { | 429 | if (err || written != pgsize) { |
430 | printk(PRINT_PREF "error: write failed at %#llx\n", | 430 | printk(PRINT_PREF "error: write failed at %#llx\n", |
431 | (long long)addr0); | 431 | (long long)addr0); |
diff --git a/drivers/mtd/tests/mtd_speedtest.c b/drivers/mtd/tests/mtd_speedtest.c index 3c9529bd0a62..c7b18e189082 100644 --- a/drivers/mtd/tests/mtd_speedtest.c +++ b/drivers/mtd/tests/mtd_speedtest.c | |||
@@ -143,7 +143,7 @@ static int write_eraseblock(int ebnum) | |||
143 | int err = 0; | 143 | int err = 0; |
144 | loff_t addr = ebnum * mtd->erasesize; | 144 | loff_t addr = ebnum * mtd->erasesize; |
145 | 145 | ||
146 | err = mtd->write(mtd, addr, mtd->erasesize, &written, iobuf); | 146 | err = mtd_write(mtd, addr, mtd->erasesize, &written, iobuf); |
147 | if (err || written != mtd->erasesize) { | 147 | if (err || written != mtd->erasesize) { |
148 | printk(PRINT_PREF "error: write failed at %#llx\n", addr); | 148 | printk(PRINT_PREF "error: write failed at %#llx\n", addr); |
149 | if (!err) | 149 | if (!err) |
@@ -161,7 +161,7 @@ static int write_eraseblock_by_page(int ebnum) | |||
161 | void *buf = iobuf; | 161 | void *buf = iobuf; |
162 | 162 | ||
163 | for (i = 0; i < pgcnt; i++) { | 163 | for (i = 0; i < pgcnt; i++) { |
164 | err = mtd->write(mtd, addr, pgsize, &written, buf); | 164 | err = mtd_write(mtd, addr, pgsize, &written, buf); |
165 | if (err || written != pgsize) { | 165 | if (err || written != pgsize) { |
166 | printk(PRINT_PREF "error: write failed at %#llx\n", | 166 | printk(PRINT_PREF "error: write failed at %#llx\n", |
167 | addr); | 167 | addr); |
@@ -184,7 +184,7 @@ static int write_eraseblock_by_2pages(int ebnum) | |||
184 | void *buf = iobuf; | 184 | void *buf = iobuf; |
185 | 185 | ||
186 | for (i = 0; i < n; i++) { | 186 | for (i = 0; i < n; i++) { |
187 | err = mtd->write(mtd, addr, sz, &written, buf); | 187 | err = mtd_write(mtd, addr, sz, &written, buf); |
188 | if (err || written != sz) { | 188 | if (err || written != sz) { |
189 | printk(PRINT_PREF "error: write failed at %#llx\n", | 189 | printk(PRINT_PREF "error: write failed at %#llx\n", |
190 | addr); | 190 | addr); |
@@ -196,7 +196,7 @@ static int write_eraseblock_by_2pages(int ebnum) | |||
196 | buf += sz; | 196 | buf += sz; |
197 | } | 197 | } |
198 | if (pgcnt % 2) { | 198 | if (pgcnt % 2) { |
199 | err = mtd->write(mtd, addr, pgsize, &written, buf); | 199 | err = mtd_write(mtd, addr, pgsize, &written, buf); |
200 | if (err || written != pgsize) { | 200 | if (err || written != pgsize) { |
201 | printk(PRINT_PREF "error: write failed at %#llx\n", | 201 | printk(PRINT_PREF "error: write failed at %#llx\n", |
202 | addr); | 202 | addr); |
diff --git a/drivers/mtd/tests/mtd_stresstest.c b/drivers/mtd/tests/mtd_stresstest.c index 83a843723880..f8aac4b7e59a 100644 --- a/drivers/mtd/tests/mtd_stresstest.c +++ b/drivers/mtd/tests/mtd_stresstest.c | |||
@@ -192,7 +192,7 @@ static int do_write(void) | |||
192 | } | 192 | } |
193 | } | 193 | } |
194 | addr = eb * mtd->erasesize + offs; | 194 | addr = eb * mtd->erasesize + offs; |
195 | err = mtd->write(mtd, addr, len, &written, writebuf); | 195 | err = mtd_write(mtd, addr, len, &written, writebuf); |
196 | if (unlikely(err || written != len)) { | 196 | if (unlikely(err || written != len)) { |
197 | printk(PRINT_PREF "error: write failed at 0x%llx\n", | 197 | printk(PRINT_PREF "error: write failed at 0x%llx\n", |
198 | (long long)addr); | 198 | (long long)addr); |
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c index d81f89a19daa..b90c01036b49 100644 --- a/drivers/mtd/tests/mtd_subpagetest.c +++ b/drivers/mtd/tests/mtd_subpagetest.c | |||
@@ -120,7 +120,7 @@ static int write_eraseblock(int ebnum) | |||
120 | loff_t addr = ebnum * mtd->erasesize; | 120 | loff_t addr = ebnum * mtd->erasesize; |
121 | 121 | ||
122 | set_random_data(writebuf, subpgsize); | 122 | set_random_data(writebuf, subpgsize); |
123 | err = mtd->write(mtd, addr, subpgsize, &written, writebuf); | 123 | err = mtd_write(mtd, addr, subpgsize, &written, writebuf); |
124 | if (unlikely(err || written != subpgsize)) { | 124 | if (unlikely(err || written != subpgsize)) { |
125 | printk(PRINT_PREF "error: write failed at %#llx\n", | 125 | printk(PRINT_PREF "error: write failed at %#llx\n", |
126 | (long long)addr); | 126 | (long long)addr); |
@@ -134,7 +134,7 @@ static int write_eraseblock(int ebnum) | |||
134 | addr += subpgsize; | 134 | addr += subpgsize; |
135 | 135 | ||
136 | set_random_data(writebuf, subpgsize); | 136 | set_random_data(writebuf, subpgsize); |
137 | err = mtd->write(mtd, addr, subpgsize, &written, writebuf); | 137 | err = mtd_write(mtd, addr, subpgsize, &written, writebuf); |
138 | if (unlikely(err || written != subpgsize)) { | 138 | if (unlikely(err || written != subpgsize)) { |
139 | printk(PRINT_PREF "error: write failed at %#llx\n", | 139 | printk(PRINT_PREF "error: write failed at %#llx\n", |
140 | (long long)addr); | 140 | (long long)addr); |
@@ -158,7 +158,7 @@ static int write_eraseblock2(int ebnum) | |||
158 | if (addr + (subpgsize * k) > (ebnum + 1) * mtd->erasesize) | 158 | if (addr + (subpgsize * k) > (ebnum + 1) * mtd->erasesize) |
159 | break; | 159 | break; |
160 | set_random_data(writebuf, subpgsize * k); | 160 | set_random_data(writebuf, subpgsize * k); |
161 | err = mtd->write(mtd, addr, subpgsize * k, &written, writebuf); | 161 | err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf); |
162 | if (unlikely(err || written != subpgsize * k)) { | 162 | if (unlikely(err || written != subpgsize * k)) { |
163 | printk(PRINT_PREF "error: write failed at %#llx\n", | 163 | printk(PRINT_PREF "error: write failed at %#llx\n", |
164 | (long long)addr); | 164 | (long long)addr); |
diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c index ecc68bf3f3f2..dd34a519fa7a 100644 --- a/drivers/mtd/tests/mtd_torturetest.c +++ b/drivers/mtd/tests/mtd_torturetest.c | |||
@@ -189,7 +189,7 @@ static inline int write_pattern(int ebnum, void *buf) | |||
189 | addr = (ebnum + 1) * mtd->erasesize - pgcnt * pgsize; | 189 | addr = (ebnum + 1) * mtd->erasesize - pgcnt * pgsize; |
190 | len = pgcnt * pgsize; | 190 | len = pgcnt * pgsize; |
191 | } | 191 | } |
192 | err = mtd->write(mtd, addr, len, &written, buf); | 192 | err = mtd_write(mtd, addr, len, &written, buf); |
193 | if (err) { | 193 | if (err) { |
194 | printk(PRINT_PREF "error %d while writing EB %d, written %zd" | 194 | printk(PRINT_PREF "error %d while writing EB %d, written %zd" |
195 | " bytes\n", err, ebnum, written); | 195 | " bytes\n", err, ebnum, written); |