diff options
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index cf0cd3146817..a932c485eb04 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c | |||
@@ -447,8 +447,6 @@ static unsigned int rptwear_cnt = 0; | |||
447 | /* MTD structure for NAND controller */ | 447 | /* MTD structure for NAND controller */ |
448 | static struct mtd_info *nsmtd; | 448 | static struct mtd_info *nsmtd; |
449 | 449 | ||
450 | static u_char ns_verify_buf[NS_LARGEST_PAGE_SIZE]; | ||
451 | |||
452 | /* | 450 | /* |
453 | * Allocate array of page pointers, create slab allocation for an array | 451 | * Allocate array of page pointers, create slab allocation for an array |
454 | * and initialize the array by NULL pointers. | 452 | * and initialize the array by NULL pointers. |
@@ -2189,19 +2187,6 @@ static void ns_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) | |||
2189 | return; | 2187 | return; |
2190 | } | 2188 | } |
2191 | 2189 | ||
2192 | static int ns_nand_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) | ||
2193 | { | ||
2194 | ns_nand_read_buf(mtd, (u_char *)&ns_verify_buf[0], len); | ||
2195 | |||
2196 | if (!memcmp(buf, &ns_verify_buf[0], len)) { | ||
2197 | NS_DBG("verify_buf: the buffer is OK\n"); | ||
2198 | return 0; | ||
2199 | } else { | ||
2200 | NS_DBG("verify_buf: the buffer is wrong\n"); | ||
2201 | return -EFAULT; | ||
2202 | } | ||
2203 | } | ||
2204 | |||
2205 | /* | 2190 | /* |
2206 | * Module initialization function | 2191 | * Module initialization function |
2207 | */ | 2192 | */ |
@@ -2236,7 +2221,6 @@ static int __init ns_init_module(void) | |||
2236 | chip->dev_ready = ns_device_ready; | 2221 | chip->dev_ready = ns_device_ready; |
2237 | chip->write_buf = ns_nand_write_buf; | 2222 | chip->write_buf = ns_nand_write_buf; |
2238 | chip->read_buf = ns_nand_read_buf; | 2223 | chip->read_buf = ns_nand_read_buf; |
2239 | chip->verify_buf = ns_nand_verify_buf; | ||
2240 | chip->read_word = ns_nand_read_word; | 2224 | chip->read_word = ns_nand_read_word; |
2241 | chip->ecc.mode = NAND_ECC_SOFT; | 2225 | chip->ecc.mode = NAND_ECC_SOFT; |
2242 | /* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */ | 2226 | /* The NAND_SKIP_BBTSCAN option is necessary for 'overridesize' */ |
@@ -2333,6 +2317,7 @@ static int __init ns_init_module(void) | |||
2333 | uint64_t new_size = (uint64_t)nsmtd->erasesize << overridesize; | 2317 | uint64_t new_size = (uint64_t)nsmtd->erasesize << overridesize; |
2334 | if (new_size >> overridesize != nsmtd->erasesize) { | 2318 | if (new_size >> overridesize != nsmtd->erasesize) { |
2335 | NS_ERR("overridesize is too big\n"); | 2319 | NS_ERR("overridesize is too big\n"); |
2320 | retval = -EINVAL; | ||
2336 | goto err_exit; | 2321 | goto err_exit; |
2337 | } | 2322 | } |
2338 | /* N.B. This relies on nand_scan not doing anything with the size before we change it */ | 2323 | /* N.B. This relies on nand_scan not doing anything with the size before we change it */ |