[U-Boot] [PATCH 1/2] nand: fix nand torture to use changed mtd api

Max Krummenacher max.oss.09 at gmail.com
Mon May 30 16:28:28 CEST 2016


The mtd subsystem deprecated and renamed the direct use of the mtd_info
struct's functionpointers. Instead the corresponding mtd_xxx function
should be used.

See also:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3c3c10bba1e4ccb75b41442e45c1a072f6cded19

Signed-off-by: Max Krummenacher <max.krummenacher at toradex.com>
---

 drivers/mtd/nand/nand_util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index 71285b6..c957c69 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -847,7 +847,7 @@ int nand_torture(nand_info_t *nand, loff_t offset)
 	}
 
 	for (i = 0; i < patt_count; i++) {
-		err = nand->erase(nand, &instr);
+		err = mtd_erase(nand, &instr);
 		if (err) {
 			printf("%s: erase() failed for block at 0x%llx: %d\n",
 				nand->name, instr.addr, err);
@@ -855,7 +855,7 @@ int nand_torture(nand_info_t *nand, loff_t offset)
 		}
 
 		/* Make sure the block contains only 0xff bytes */
-		err = nand->read(nand, offset, nand->erasesize, &retlen, buf);
+		err = mtd_read(nand, offset, nand->erasesize, &retlen, buf);
 		if ((err && err != -EUCLEAN) || retlen != nand->erasesize) {
 			printf("%s: read() failed for block at 0x%llx: %d\n",
 				nand->name, instr.addr, err);
@@ -872,14 +872,14 @@ int nand_torture(nand_info_t *nand, loff_t offset)
 
 		/* Write a pattern and check it */
 		memset(buf, patterns[i], nand->erasesize);
-		err = nand->write(nand, offset, nand->erasesize, &retlen, buf);
+		err = mtd_write(nand, offset, nand->erasesize, &retlen, buf);
 		if (err || retlen != nand->erasesize) {
 			printf("%s: write() failed for block at 0x%llx: %d\n",
 				nand->name, instr.addr, err);
 			goto out;
 		}
 
-		err = nand->read(nand, offset, nand->erasesize, &retlen, buf);
+		err = mtd_read(nand, offset, nand->erasesize, &retlen, buf);
 		if ((err && err != -EUCLEAN) || retlen != nand->erasesize) {
 			printf("%s: read() failed for block at 0x%llx: %d\n",
 				nand->name, instr.addr, err);
-- 
2.5.5



More information about the U-Boot mailing list