diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-07-25 16:31:52 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-08-01 10:45:59 +0300 |
commit | 3d3fe3c05d5a17ebdf55b936c51017c127c0ed44 (patch) | |
tree | 82015f37c2af2e3563a6118d378e28a31b73c991 /drivers/mtd/nand/raw/nand_micron.c | |
parent | 2023f1fa216f30b1877d65be2057fbaf0bbd49b3 (diff) | |
download | linux-3d3fe3c05d5a17ebdf55b936c51017c127c0ed44.tar.xz |
mtd: rawnand: allocate dynamically ONFI parameters during detection
Now that it is possible to do dynamic allocations during the
identification phase, convert the onfi_params structure (which is only
needed with ONFI compliant chips) into a pointer that will be allocated
only if needed.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/nand_micron.c')
-rw-r--r-- | drivers/mtd/nand/raw/nand_micron.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/nand_micron.c b/drivers/mtd/nand/raw/nand_micron.c index 656947d91841..f5dc0a7a2456 100644 --- a/drivers/mtd/nand/raw/nand_micron.c +++ b/drivers/mtd/nand/raw/nand_micron.c @@ -88,9 +88,10 @@ static int micron_nand_setup_read_retry(struct mtd_info *mtd, int retry_mode) static int micron_nand_onfi_init(struct nand_chip *chip) { struct nand_parameters *p = &chip->parameters; - struct nand_onfi_vendor_micron *micron = (void *)p->onfi.vendor; - if (chip->parameters.onfi.version && p->onfi.vendor_revision) { + if (p->onfi) { + struct nand_onfi_vendor_micron *micron = (void *)p->onfi->vendor; + chip->read_retries = micron->read_retry_options; chip->setup_read_retry = micron_nand_setup_read_retry; } @@ -382,7 +383,7 @@ static int micron_supports_on_die_ecc(struct nand_chip *chip) u8 id[5]; int ret; - if (!chip->parameters.onfi.version) + if (!chip->parameters.onfi) return MICRON_ON_DIE_UNSUPPORTED; if (chip->bits_per_cell != 1) |