Skip to content

Commit 4cbb9b8

Browse files
author
Thomas Gleixner
committed
Merge branch 'master' of /home/tglx/work/kernel/git/mtd-2.6/
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2 parents 6dfc6d2 + 9fe4854 commit 4cbb9b8

32 files changed

+357
-415
lines changed

drivers/mtd/chips/cfi_cmdset_0001.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,12 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
545545
if (extp->MinorVersion >= '4') {
546546
struct cfi_intelext_programming_regioninfo *prinfo;
547547
prinfo = (struct cfi_intelext_programming_regioninfo *)&extp->extra[offs];
548-
MTD_PROGREGION_SIZE(mtd) = cfi->interleave << prinfo->ProgRegShift;
548+
mtd->writesize = cfi->interleave << prinfo->ProgRegShift;
549549
MTD_PROGREGION_CTRLMODE_VALID(mtd) = cfi->interleave * prinfo->ControlValid;
550550
MTD_PROGREGION_CTRLMODE_INVALID(mtd) = cfi->interleave * prinfo->ControlInvalid;
551-
mtd->flags |= MTD_PROGRAM_REGIONS;
551+
mtd->flags &= ~MTD_BIT_WRITEABLE;
552552
printk(KERN_DEBUG "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n",
553-
map->name, MTD_PROGREGION_SIZE(mtd),
553+
map->name, mtd->writesize,
554554
MTD_PROGREGION_CTRLMODE_VALID(mtd),
555555
MTD_PROGREGION_CTRLMODE_INVALID(mtd));
556556
}

drivers/mtd/chips/cfi_cmdset_0020.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ static struct mtd_info *cfi_staa_setup(struct map_info *map)
238238
mtd->unlock = cfi_staa_unlock;
239239
mtd->suspend = cfi_staa_suspend;
240240
mtd->resume = cfi_staa_resume;
241-
mtd->flags = MTD_CAP_NORFLASH;
242-
mtd->flags |= MTD_ECC; /* FIXME: Not all STMicro flashes have this */
243-
mtd->eccsize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */
241+
mtd->flags = MTD_CAP_NORFLASH & ~MTD_BIT_WRITEABLE;
242+
mtd->writesize = 8; /* FIXME: Should be 0 for STMicro flashes w/out ECC */
244243
map->fldrv = &cfi_staa_chipdrv;
245244
__module_get(THIS_MODULE);
246245
mtd->name = map->name;

drivers/mtd/devices/doc2000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ void DoC2k_init(struct mtd_info *mtd)
579579
mtd->ecctype = MTD_ECC_RS_DiskOnChip;
580580
mtd->size = 0;
581581
mtd->erasesize = 0;
582-
mtd->oobblock = 512;
582+
mtd->writesize = 512;
583583
mtd->oobsize = 16;
584584
mtd->owner = THIS_MODULE;
585585
mtd->erase = doc_erase;

drivers/mtd/devices/doc2001.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ void DoCMil_init(struct mtd_info *mtd)
361361
/* FIXME: erase size is not always 8KiB */
362362
mtd->erasesize = 0x2000;
363363

364-
mtd->oobblock = 512;
364+
mtd->writesize = 512;
365365
mtd->oobsize = 16;
366366
mtd->owner = THIS_MODULE;
367367
mtd->erase = doc_erase;

drivers/mtd/devices/doc2001plus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void DoCMilPlus_init(struct mtd_info *mtd)
483483
mtd->size = 0;
484484

485485
mtd->erasesize = 0;
486-
mtd->oobblock = 512;
486+
mtd->writesize = 512;
487487
mtd->oobsize = 16;
488488
mtd->owner = THIS_MODULE;
489489
mtd->erase = doc_erase;

drivers/mtd/mtdconcat.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
278278
return -EINVAL;
279279

280280
/* Check alignment */
281-
if (mtd->oobblock > 1) {
281+
if (mtd->writesize > 1) {
282282
loff_t __to = to;
283-
if (do_div(__to, mtd->oobblock) || (total_len % mtd->oobblock))
283+
if (do_div(__to, mtd->writesize) || (total_len % mtd->writesize))
284284
return -EINVAL;
285285
}
286286

@@ -334,7 +334,7 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
334334
*retlen += retsize;
335335
total_len -= wsize;
336336
if (concat->mtd.type == MTD_NANDFLASH && eccbuf)
337-
eccbuf += mtd->oobavail * (wsize / mtd->oobblock);
337+
eccbuf += mtd->oobavail * (wsize / mtd->writesize);
338338

339339
if (total_len == 0)
340340
break;
@@ -833,7 +833,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
833833
concat->mtd.flags = subdev[0]->flags;
834834
concat->mtd.size = subdev[0]->size;
835835
concat->mtd.erasesize = subdev[0]->erasesize;
836-
concat->mtd.oobblock = subdev[0]->oobblock;
836+
concat->mtd.writesize = subdev[0]->writesize;
837837
concat->mtd.oobsize = subdev[0]->oobsize;
838838
concat->mtd.ecctype = subdev[0]->ecctype;
839839
concat->mtd.eccsize = subdev[0]->eccsize;
@@ -881,7 +881,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
881881
subdev[i]->flags & MTD_WRITEABLE;
882882
}
883883
concat->mtd.size += subdev[i]->size;
884-
if (concat->mtd.oobblock != subdev[i]->oobblock ||
884+
if (concat->mtd.writesize != subdev[i]->writesize ||
885885
concat->mtd.oobsize != subdev[i]->oobsize ||
886886
concat->mtd.ecctype != subdev[i]->ecctype ||
887887
concat->mtd.eccsize != subdev[i]->eccsize ||

drivers/mtd/mtdpart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int add_mtd_partitions(struct mtd_info *master,
398398
slave->mtd.type = master->type;
399399
slave->mtd.flags = master->flags & ~parts[i].mask_flags;
400400
slave->mtd.size = parts[i].size;
401-
slave->mtd.oobblock = master->oobblock;
401+
slave->mtd.writesize = master->writesize;
402402
slave->mtd.oobsize = master->oobsize;
403403
slave->mtd.oobavail = master->oobavail;
404404
slave->mtd.ecctype = master->ecctype;

drivers/mtd/nand/au1550nd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ static void au1550_command(struct mtd_info *mtd, unsigned command, int column, i
356356
if (command == NAND_CMD_SEQIN) {
357357
int readcmd;
358358

359-
if (column >= mtd->oobblock) {
359+
if (column >= mtd->writesize) {
360360
/* OOB area */
361-
column -= mtd->oobblock;
361+
column -= mtd->writesize;
362362
readcmd = NAND_CMD_READOOB;
363363
} else if (column < 256) {
364364
/* First 256 bytes --> READ0 */

drivers/mtd/nand/diskonchip.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,9 @@ static void doc2001plus_command(struct mtd_info *mtd, unsigned command, int colu
761761
if (command == NAND_CMD_SEQIN) {
762762
int readcmd;
763763

764-
if (column >= mtd->oobblock) {
764+
if (column >= mtd->writesize) {
765765
/* OOB area */
766-
column -= mtd->oobblock;
766+
column -= mtd->writesize;
767767
readcmd = NAND_CMD_READOOB;
768768
} else if (column < 256) {
769769
/* First 256 bytes --> READ0 */
@@ -1093,8 +1093,8 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf, const ch
10931093
size_t retlen;
10941094

10951095
for (offs = 0; offs < mtd->size; offs += mtd->erasesize) {
1096-
ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf);
1097-
if (retlen != mtd->oobblock)
1096+
ret = mtd->read(mtd, offs, mtd->writesize, &retlen, buf);
1097+
if (retlen != mtd->writesize)
10981098
continue;
10991099
if (ret) {
11001100
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
11181118
/* Only one mediaheader was found. We want buf to contain a
11191119
mediaheader on return, so we'll have to re-read the one we found. */
11201120
offs = doc->mh0_page << this->page_shift;
1121-
ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf);
1122-
if (retlen != mtd->oobblock) {
1121+
ret = mtd->read(mtd, offs, mtd->writesize, &retlen, buf);
1122+
if (retlen != mtd->writesize) {
11231123
/* Insanity. Give up. */
11241124
printk(KERN_ERR "Read DiskOnChip Media Header once, but can't reread it???\n");
11251125
return 0;
@@ -1139,7 +1139,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd, struct mtd_partitio
11391139
unsigned blocks, maxblocks;
11401140
int offs, numheaders;
11411141

1142-
buf = kmalloc(mtd->oobblock, GFP_KERNEL);
1142+
buf = kmalloc(mtd->writesize, GFP_KERNEL);
11431143
if (!buf) {
11441144
printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n");
11451145
return 0;
@@ -1247,7 +1247,7 @@ static inline int __init inftl_partscan(struct mtd_info *mtd, struct mtd_partiti
12471247
if (inftl_bbt_write)
12481248
end -= (INFTL_BBT_RESERVED_BLOCKS << this->phys_erase_shift);
12491249

1250-
buf = kmalloc(mtd->oobblock, GFP_KERNEL);
1250+
buf = kmalloc(mtd->writesize, GFP_KERNEL);
12511251
if (!buf) {
12521252
printk(KERN_ERR "DiskOnChip mediaheader kmalloc failed!\n");
12531253
return 0;

0 commit comments

Comments
 (0)