diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-07-25 15:31:52 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-08-01 09:45:59 +0200 |
commit | 3d3fe3c05d5a17ebdf55b936c51017c127c0ed44 (patch) | |
tree | 82015f37c2af2e3563a6118d378e28a31b73c991 /include/linux/mtd | |
parent | 2023f1fa216f30b1877d65be2057fbaf0bbd49b3 (diff) | |
download | linux-3d3fe3c05d5a17ebdf55b936c51017c127c0ed44.tar.gz linux-3d3fe3c05d5a17ebdf55b936c51017c127c0ed44.tar.bz2 linux-3d3fe3c05d5a17ebdf55b936c51017c127c0ed44.zip |
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 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/rawnand.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 099fa166569a..efb2345359bb 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -482,7 +482,7 @@ struct nand_parameters { DECLARE_BITMAP(get_feature_list, ONFI_FEATURE_NUMBER); /* ONFI parameters */ - struct onfi_params onfi; + struct onfi_params *onfi; }; /* The maximum expected count of bytes in the NAND ID sequence */ @@ -1618,10 +1618,10 @@ struct platform_nand_data { /* return the supported asynchronous timing mode. */ static inline int onfi_get_async_timing_mode(struct nand_chip *chip) { - if (!chip->parameters.onfi.version) + if (!chip->parameters.onfi) return ONFI_TIMING_MODE_UNKNOWN; - return chip->parameters.onfi.async_timing_mode; + return chip->parameters.onfi->async_timing_mode; } int onfi_fill_data_interface(struct nand_chip *chip, |