Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27895
b: refs/heads/master
c: ba0251f
h: refs/heads/master
i:
  27893: 6b023c5
  27891: eb345ae
  27887: ce37024
v: v3
  • Loading branch information
Thomas Gleixner committed May 26, 2006
1 parent f196bdc commit 2abf39a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 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: cca3b837bbb4c984165f9f9c7c06846bc0425791
refs/heads/master: ba0251fe87ea560eb377917e06ba0b5b9ab89094
17 changes: 10 additions & 7 deletions trunk/drivers/mtd/nand/nand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1954,10 +1954,13 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
if (!type)
return ERR_PTR(-ENODEV);

chip->chipsize = nand_flash_ids[i].chipsize << 20;
if (!mtd->name)
mtd->name = type->name;

chip->chipsize = type->chipsize << 20;

/* Newer devices have all the information in additional id bytes */
if (!nand_flash_ids[i].pagesize) {
if (!type->pagesize) {
int extid;
/* The 3rd id byte contains non relevant data ATM */
extid = chip->read_byte(mtd);
Expand All @@ -1979,10 +1982,10 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
/*
* Old devices have chip data hardcoded in the device id table
*/
mtd->erasesize = nand_flash_ids[i].erasesize;
mtd->writesize = nand_flash_ids[i].pagesize;
mtd->erasesize = type->erasesize;
mtd->writesize = type->pagesize;
mtd->oobsize = mtd->writesize / 32;
busw = nand_flash_ids[i].options & NAND_BUSWIDTH_16;
busw = type->options & NAND_BUSWIDTH_16;
}

/* Try to identify manufacturer */
Expand Down Expand Up @@ -2020,7 +2023,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,

/* Get chip options, preserve non chip based options */
chip->options &= ~NAND_CHIPOPTIONS_MSK;
chip->options |= nand_flash_ids[i].options & NAND_CHIPOPTIONS_MSK;
chip->options |= type->options & NAND_CHIPOPTIONS_MSK;

/*
* Set chip as a default. Board drivers can override it, if necessary
Expand All @@ -2030,7 +2033,7 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
/* Check if chip is a not a samsung device. Do not clear the
* options for chips which are not having an extended id.
*/
if (*maf_id != NAND_MFR_SAMSUNG && !nand_flash_ids[i].pagesize)
if (*maf_id != NAND_MFR_SAMSUNG && !type->pagesize)
chip->options &= ~NAND_SAMSUNG_LP_OPTIONS;

/* Check for AND chips with 4 page planes */
Expand Down

0 comments on commit 2abf39a

Please sign in to comment.