mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mtd: add init_size hook for NAND driver
Not all the NAND devices have all the information in additional
id bytes.
So add a hook in the nand_chip{} is a good method to calculate the
right value of oobsize, erasesize and so on.
Without the hook,you will get the wrong value, and you have to hack
in the ->scan_bbt() to change the wrong value which make the code
mess.
Signed-off-by: Huang Shijie <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
This commit is contained in:
parent
088bd455c9
commit
12a40a57f7
2 changed files with 10 additions and 2 deletions
|
|
@ -2976,8 +2976,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
|
|||
|
||||
chip->chipsize = (uint64_t)type->chipsize << 20;
|
||||
|
||||
/* Newer devices have all the information in additional id bytes */
|
||||
if (!type->pagesize) {
|
||||
if (!type->pagesize && chip->init_size) {
|
||||
/* set the pagesize, oobsize, erasesize by the driver*/
|
||||
busw = chip->init_size(mtd, chip, id_data);
|
||||
} else if (!type->pagesize) {
|
||||
int extid;
|
||||
/* The 3rd id byte holds MLC / multichip data */
|
||||
chip->cellinfo = id_data[2];
|
||||
|
|
|
|||
Loading…
Reference in a new issue