aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/diskonchip.c
diff options
context:
space:
mode:
authorJoern Engel <joern@wh.fh-wedel.de>2006-05-22 17:18:05 -0400
committerJoern Engel <joern@wh.fh-wedel.de>2006-05-22 17:18:05 -0400
commit28318776a80bc3261f9af91ef79e6e38bb9f5bec (patch)
tree36ef9144accf19db9d51019aa479807e80aeb8fd /drivers/mtd/nand/diskonchip.c
parent8ca9ed5db3aea8d27989c239e8a2f79b839f1e99 (diff)
[MTD] Introduce writesize
At least two flashes exists that have the concept of a minimum write unit, similar to NAND pages, but no other NAND characteristics. Therefore, rename the minimum write unit to "writesize" for all flashes, including NAND. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
Diffstat (limited to 'drivers/mtd/nand/diskonchip.c')
-rw-r--r--drivers/mtd/nand/diskonchip.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index a2391c66a63f..d160930276d6 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -761,9 +761,9 @@ static void doc2001plus_command(struct mtd_info *mtd, unsigned command, int colu
761 if (command == NAND_CMD_SEQIN) { 761 if (command == NAND_CMD_SEQIN) {
762 int readcmd; 762 int readcmd;
763 763
764 if (column >= mtd->oobblock) { 764 if (column >= mtd->writesize) {
765 /* OOB area */ 765 /* OOB area */
766 column -= mtd->oobblock; 766 column -= mtd->writesize;
767 readcmd = NAND_CMD_READOOB; 767 readcmd = NAND_CMD_READOOB;
768 } else if (column < 256) { 768 } else if (column < 256) {
769 /* First 256 bytes --> READ0 */ 769 /* First 256 bytes --> READ0 */
@@ -1093,8 +1093,8 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
1093 size_t retlen; 1093 size_t retlen;
1094 1094
1095 for (offs = 0; offs < mtd->size; offs += mtd->erasesize) { 1095 for (offs = 0; offs < mtd->size; offs += mtd->erasesize) {
1096 ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf); 1096 ret = mtd->read(mtd, offs, mtd->writesize, &retlen, buf);
1097 if (retlen != mtd->oobblock) 1097 if (retlen != mtd->writesize)
1098 continue; 1098 continue;
1099 if (ret) { 1099 if (ret) {
1100 printk(KERN_WARNING "ECC error scanning DOC at 0x%x\n", offs); 1100 printk(KERN_WARNING "ECC error scanning DOC at 0x%x\n", offs);
@@ -1118,8 +1118,8 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
1118 /* Only one mediaheader was found. We want buf to contain a 1118 /* Only one mediaheader was found. We want buf to contain a
1119 mediaheader on return, so we'll have to re-read the one we found. */ 1119 mediaheader on return, so we'll have to re-read the one we found. */
1120 offs = doc->mh0_page << this->page_shift; 1120 offs = doc->mh0_page << this->page_shift;
1121 ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf); 1121 ret = mtd->read(mtd, offs, mtd->writesize, &retlen, buf);
1122 if (retlen != mtd->oobblock) { 1122 if (retlen != mtd->writesize) {
1123 /* Insanity. Give up. */ 1123 /* Insanity. Give up. */
1124 printk(KERN_ERR "Read DiskOnChip Media Header once, but can't reread it???\n"); 1124 printk(KERN_ERR "Read DiskOnChip Media Header once, but can't reread it???\n");
1125 return 0; 1125 return 0;
@@ -1139,7 +1139,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
1139 unsigned blocks, maxblocks; 1139 unsigned blocks, maxblocks;
1140 int offs, numheaders; 1140 int offs, numheaders;
1141 1141
1142 buf = kmalloc(mtd->oobblock, GFP_KERNEL); 1142 buf = kmalloc(mtd->writesize, GFP_KERNEL);
1143 if (!buf) { 1143 if (!buf) {
1144 printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n"); 1144 printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n");
1145 return 0; 1145 return 0;
@@ -1247,7 +1247,7 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
1247 if (inftl_bbt_write) 1247 if (inftl_bbt_write)
1248 end -= (INFTL_BBT_RESERVED_BLOCKS << this->phys_erase_shift); 1248 end -= (INFTL_BBT_RESERVED_BLOCKS << this->phys_erase_shift);
1249 1249
1250 buf = kmalloc(mtd->oobblock, GFP_KERNEL); 1250 buf = kmalloc(mtd->writesize, GFP_KERNEL);
1251 if (!buf) { 1251 if (!buf) {
1252 printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n"); 1252 printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n");
1253 return 0; 1253 return 0;