Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27902
b: refs/heads/master
c: ff268fb
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed May 29, 2006
1 parent d80290f commit bcfa565
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8be834f76291fdcc0614cb84926c6910b9f2ecbc
refs/heads/master: ff268fb8791cf18df536113355d7184007c269d9
10 changes: 2 additions & 8 deletions trunk/drivers/mtd/mtdchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,10 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
break;
}

case MEMSETOOBSEL:
{
if (copy_from_user(&mtd->oobinfo, argp, sizeof(struct nand_oobinfo)))
return -EFAULT;
break;
}

case MEMGETOOBSEL:
{
if (copy_to_user(argp, &(mtd->oobinfo), sizeof(struct nand_oobinfo)))
if (copy_to_user(argp, mtd->oobinfo,
sizeof(struct nand_oobinfo)))
return -EFAULT;
break;
}
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/mtd/mtdconcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,9 +766,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c

}

if(concat->mtd.type == MTD_NANDFLASH)
memcpy(&concat->mtd.oobinfo, &subdev[0]->oobinfo,
sizeof(struct nand_oobinfo));
concat->mtd.oobinfo = subdev[0]->oobinfo;

concat->num_subdev = num_devs;
concat->mtd.name = name;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/mtd/mtdpart.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ int add_mtd_partitions(struct mtd_info *master,
slave->mtd.size = parts[i].size;
slave->mtd.writesize = master->writesize;
slave->mtd.oobsize = master->oobsize;
slave->mtd.oobavail = master->oobavail;
slave->mtd.ecctype = master->ecctype;
slave->mtd.eccsize = master->eccsize;

Expand Down Expand Up @@ -435,8 +434,7 @@ int add_mtd_partitions(struct mtd_info *master,
parts[i].name);
}

/* copy oobinfo from master */
memcpy(&slave->mtd.oobinfo, &master->oobinfo, sizeof(slave->mtd.oobinfo));
slave->mtd.oobinfo = master->oobinfo;

if(parts[i].mtdp)
{ /* store the object pointer (caller may or may not register it */
Expand Down
10 changes: 1 addition & 9 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2142,14 +2142,6 @@ int nand_scan(struct mtd_info *mtd, int maxchips)
}
}

/*
* The number of bytes available for the filesystem to place fs
* dependend oob data
*/
mtd->oobavail = 0;
for (i = 0; chip->autooob->oobfree[i][1]; i++)
mtd->oobavail += chip->autooob->oobfree[i][1];

/*
* check ECC mode, default to software if 3byte/512byte hardware ECC is
* selected and we have 256 byte pagesize fallback to software ECC
Expand Down Expand Up @@ -2245,7 +2237,7 @@ int nand_scan(struct mtd_info *mtd, int maxchips)
mtd->block_markbad = nand_block_markbad;

/* and make the autooob the default one */
memcpy(&mtd->oobinfo, chip->autooob, sizeof(mtd->oobinfo));
mtd->oobinfo = chip->autooob;

/* Check, if we should skip the bad block table scan */
if (chip->options & NAND_SKIP_BBTSCAN)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
break;
}

memcpy(&mtd->oobinfo, this->autooob, sizeof(mtd->oobinfo));
mtd->oobinfo = this->autooob;

/* Fill in remaining MTD driver data */
mtd->type = MTD_NANDFLASH;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/jffs2/wbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ static struct nand_oobinfo jffs2_oobinfo_docecc = {

static int jffs2_nand_set_oobinfo(struct jffs2_sb_info *c)
{
struct nand_oobinfo *oinfo = &c->mtd->oobinfo;
struct nand_oobinfo *oinfo = c->mtd->oobinfo;

/* Do this only, if we have an oob buffer */
if (!c->mtd->oobsize)
Expand Down
5 changes: 2 additions & 3 deletions trunk/include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ struct mtd_info {
char *name;
int index;

// oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
struct nand_oobinfo oobinfo;
u_int32_t oobavail; // Number of bytes in OOB area available for fs
/* oobinfo structure pointer - read only ! */
struct nand_oobinfo *oobinfo;

/* Data for variable erase regions. If numeraseregions is zero,
* it means that the whole device has erasesize as given above.
Expand Down

0 comments on commit bcfa565

Please sign in to comment.