mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
[MTD] [NAND] make oobavail public
During the MTD rework the oobavail parameter of mtd_info structure has become private. This is not quite correct in terms of integrity and logic. If we have means to write to OOB area, then we'd like to know upfront how many bytes out of OOB are spare per page to be able to adapt to specific cases. The patch inlined adds the public oobavail parameter. Signed-off-by: Vitaly Wool <[email protected]> Signed-off-by: David Woodhouse <[email protected]>
This commit is contained in:
parent
eee8abe5de
commit
1f92267c51
5 changed files with 5 additions and 0 deletions
|
|
@ -727,6 +727,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
|
|||
concat->mtd.erasesize = subdev[0]->erasesize;
|
||||
concat->mtd.writesize = subdev[0]->writesize;
|
||||
concat->mtd.oobsize = subdev[0]->oobsize;
|
||||
concat->mtd.oobavail = subdev[0]->oobavail;
|
||||
if (subdev[0]->writev)
|
||||
concat->mtd.writev = concat_writev;
|
||||
if (subdev[0]->read_oob)
|
||||
|
|
|
|||
|
|
@ -338,6 +338,7 @@ 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.subpage_sft = master->subpage_sft;
|
||||
|
||||
slave->mtd.name = parts[i].name;
|
||||
|
|
|
|||
|
|
@ -2524,6 +2524,7 @@ int nand_scan_tail(struct mtd_info *mtd)
|
|||
for (i = 0; chip->ecc.layout->oobfree[i].length; i++)
|
||||
chip->ecc.layout->oobavail +=
|
||||
chip->ecc.layout->oobfree[i].length;
|
||||
mtd->oobavail = chip->ecc.layout->oobavail;
|
||||
|
||||
/*
|
||||
* Set the number of read / write steps for one page depending on ECC
|
||||
|
|
|
|||
|
|
@ -2367,6 +2367,7 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
|
|||
for (i = 0; this->ecclayout->oobfree[i].length; i++)
|
||||
this->ecclayout->oobavail +=
|
||||
this->ecclayout->oobfree[i].length;
|
||||
mtd->oobavail = this->ecclayout->oobavail;
|
||||
|
||||
mtd->ecclayout = this->ecclayout;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue