diff options
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/diskonchip.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 6 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_ecc.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 14 |
6 files changed, 22 insertions, 8 deletions
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig index 8f9c3baeb38e..246d4512f64b 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig | |||
@@ -300,7 +300,7 @@ config MTD_NAND_PLATFORM | |||
300 | via platform_data. | 300 | via platform_data. |
301 | 301 | ||
302 | config MTD_ALAUDA | 302 | config MTD_ALAUDA |
303 | tristate "MTD driver for Olympus MAUSB-10 and Fijufilm DPC-R1" | 303 | tristate "MTD driver for Olympus MAUSB-10 and Fujifilm DPC-R1" |
304 | depends on MTD_NAND && USB | 304 | depends on MTD_NAND && USB |
305 | help | 305 | help |
306 | These two (and possibly other) Alauda-based cardreaders for | 306 | These two (and possibly other) Alauda-based cardreaders for |
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index ab9f5c5db38d..0e72153b3297 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c | |||
@@ -220,7 +220,7 @@ static int doc_ecc_decode(struct rs_control *rs, uint8_t *data, uint8_t *ecc) | |||
220 | } | 220 | } |
221 | } | 221 | } |
222 | /* If the parity is wrong, no rescue possible */ | 222 | /* If the parity is wrong, no rescue possible */ |
223 | return parity ? -1 : nerr; | 223 | return parity ? -EBADMSG : nerr; |
224 | } | 224 | } |
225 | 225 | ||
226 | static void DoC_Delay(struct doc_priv *doc, unsigned short cycles) | 226 | static void DoC_Delay(struct doc_priv *doc, unsigned short cycles) |
@@ -1034,7 +1034,7 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat, | |||
1034 | WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf); | 1034 | WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf); |
1035 | else | 1035 | else |
1036 | WriteDOC(DOC_ECC_DIS, docptr, ECCConf); | 1036 | WriteDOC(DOC_ECC_DIS, docptr, ECCConf); |
1037 | if (no_ecc_failures && (ret == -1)) { | 1037 | if (no_ecc_failures && (ret == -EBADMSG)) { |
1038 | printk(KERN_ERR "suppressing ECC failure\n"); | 1038 | printk(KERN_ERR "suppressing ECC failure\n"); |
1039 | ret = 0; | 1039 | ret = 0; |
1040 | } | 1040 | } |
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index b4e0e7723894..e29c1da7f56e 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -789,7 +789,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
789 | int stat; | 789 | int stat; |
790 | 790 | ||
791 | stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); | 791 | stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); |
792 | if (stat == -1) | 792 | if (stat < 0) |
793 | mtd->ecc_stats.failed++; | 793 | mtd->ecc_stats.failed++; |
794 | else | 794 | else |
795 | mtd->ecc_stats.corrected += stat; | 795 | mtd->ecc_stats.corrected += stat; |
@@ -833,7 +833,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
833 | int stat; | 833 | int stat; |
834 | 834 | ||
835 | stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); | 835 | stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); |
836 | if (stat == -1) | 836 | if (stat < 0) |
837 | mtd->ecc_stats.failed++; | 837 | mtd->ecc_stats.failed++; |
838 | else | 838 | else |
839 | mtd->ecc_stats.corrected += stat; | 839 | mtd->ecc_stats.corrected += stat; |
@@ -874,7 +874,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip, | |||
874 | chip->read_buf(mtd, oob, eccbytes); | 874 | chip->read_buf(mtd, oob, eccbytes); |
875 | stat = chip->ecc.correct(mtd, p, oob, NULL); | 875 | stat = chip->ecc.correct(mtd, p, oob, NULL); |
876 | 876 | ||
877 | if (stat == -1) | 877 | if (stat < 0) |
878 | mtd->ecc_stats.failed++; | 878 | mtd->ecc_stats.failed++; |
879 | else | 879 | else |
880 | mtd->ecc_stats.corrected += stat; | 880 | mtd->ecc_stats.corrected += stat; |
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c index fde593e5e634..9003a135e050 100644 --- a/drivers/mtd/nand/nand_ecc.c +++ b/drivers/mtd/nand/nand_ecc.c | |||
@@ -189,7 +189,7 @@ int nand_correct_data(struct mtd_info *mtd, u_char *dat, | |||
189 | if(countbits(s0 | ((uint32_t)s1 << 8) | ((uint32_t)s2 <<16)) == 1) | 189 | if(countbits(s0 | ((uint32_t)s1 << 8) | ((uint32_t)s2 <<16)) == 1) |
190 | return 1; | 190 | return 1; |
191 | 191 | ||
192 | return -1; | 192 | return -EBADMSG; |
193 | } | 193 | } |
194 | EXPORT_SYMBOL(nand_correct_data); | 194 | EXPORT_SYMBOL(nand_correct_data); |
195 | 195 | ||
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index a7574807dc46..10490b48d9f7 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c | |||
@@ -511,7 +511,7 @@ static int init_nandsim(struct mtd_info *mtd) | |||
511 | } | 511 | } |
512 | 512 | ||
513 | if (ns->options & OPT_SMALLPAGE) { | 513 | if (ns->options & OPT_SMALLPAGE) { |
514 | if (ns->geom.totsz < (64 << 20)) { | 514 | if (ns->geom.totsz < (32 << 20)) { |
515 | ns->geom.pgaddrbytes = 3; | 515 | ns->geom.pgaddrbytes = 3; |
516 | ns->geom.secaddrbytes = 2; | 516 | ns->geom.secaddrbytes = 2; |
517 | } else { | 517 | } else { |
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 21b921dd6aab..66f76e9618dd 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -488,12 +488,24 @@ static void s3c2410_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) | |||
488 | readsb(this->IO_ADDR_R, buf, len); | 488 | readsb(this->IO_ADDR_R, buf, len); |
489 | } | 489 | } |
490 | 490 | ||
491 | static void s3c2440_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) | ||
492 | { | ||
493 | struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); | ||
494 | readsl(info->regs + S3C2440_NFDATA, buf, len / 4); | ||
495 | } | ||
496 | |||
491 | static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | 497 | static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) |
492 | { | 498 | { |
493 | struct nand_chip *this = mtd->priv; | 499 | struct nand_chip *this = mtd->priv; |
494 | writesb(this->IO_ADDR_W, buf, len); | 500 | writesb(this->IO_ADDR_W, buf, len); |
495 | } | 501 | } |
496 | 502 | ||
503 | static void s3c2440_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | ||
504 | { | ||
505 | struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); | ||
506 | writesl(info->regs + S3C2440_NFDATA, buf, len / 4); | ||
507 | } | ||
508 | |||
497 | /* device management functions */ | 509 | /* device management functions */ |
498 | 510 | ||
499 | static int s3c2410_nand_remove(struct platform_device *pdev) | 511 | static int s3c2410_nand_remove(struct platform_device *pdev) |
@@ -604,6 +616,8 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info, | |||
604 | info->sel_bit = S3C2440_NFCONT_nFCE; | 616 | info->sel_bit = S3C2440_NFCONT_nFCE; |
605 | chip->cmd_ctrl = s3c2440_nand_hwcontrol; | 617 | chip->cmd_ctrl = s3c2440_nand_hwcontrol; |
606 | chip->dev_ready = s3c2440_nand_devready; | 618 | chip->dev_ready = s3c2440_nand_devready; |
619 | chip->read_buf = s3c2440_nand_read_buf; | ||
620 | chip->write_buf = s3c2440_nand_write_buf; | ||
607 | break; | 621 | break; |
608 | 622 | ||
609 | case TYPE_S3C2412: | 623 | case TYPE_S3C2412: |