diff options
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index d315b513db5c..8a7f960a0df5 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -584,7 +584,16 @@ static void s3c2410_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) | |||
584 | static void s3c2440_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) | 584 | static void s3c2440_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) |
585 | { | 585 | { |
586 | struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); | 586 | struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); |
587 | readsl(info->regs + S3C2440_NFDATA, buf, len / 4); | 587 | |
588 | readsl(info->regs + S3C2440_NFDATA, buf, len >> 2); | ||
589 | |||
590 | /* cleanup if we've got less than a word to do */ | ||
591 | if (len & 3) { | ||
592 | buf += len & ~3; | ||
593 | |||
594 | for (; len & 3; len--) | ||
595 | *buf++ = readb(info->regs + S3C2440_NFDATA); | ||
596 | } | ||
588 | } | 597 | } |
589 | 598 | ||
590 | static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | 599 | static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) |
@@ -596,7 +605,16 @@ static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int | |||
596 | static void s3c2440_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) | 605 | static void s3c2440_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) |
597 | { | 606 | { |
598 | struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); | 607 | struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd); |
599 | writesl(info->regs + S3C2440_NFDATA, buf, len / 4); | 608 | |
609 | writesl(info->regs + S3C2440_NFDATA, buf, len >> 2); | ||
610 | |||
611 | /* cleanup any fractional write */ | ||
612 | if (len & 3) { | ||
613 | buf += len & ~3; | ||
614 | |||
615 | for (; len & 3; len--, buf++) | ||
616 | writeb(*buf, info->regs + S3C2440_NFDATA); | ||
617 | } | ||
600 | } | 618 | } |
601 | 619 | ||
602 | /* cpufreq driver support */ | 620 | /* cpufreq driver support */ |