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;
}
}
- 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;
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;
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 */
}
}
- /*
- * 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
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)
break;
}
- memcpy(&mtd->oobinfo, this->autooob, sizeof(mtd->oobinfo));
+ mtd->oobinfo = this->autooob;
/* Fill in remaining MTD driver data */
mtd->type = MTD_NANDFLASH;
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)
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.