summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/rawnand.h
diff options
context:
space:
mode:
authorMiquel Raynal2018-07-25 15:31:52 +0200
committerMiquel Raynal2018-08-01 09:45:59 +0200
commit3d3fe3c05d5a17ebdf55b936c51017c127c0ed44 (patch)
tree82015f37c2af2e3563a6118d378e28a31b73c991 /include/linux/mtd/rawnand.h
parentmtd: rawnand: allocate model parameter dynamically (diff)
downloadkernel-qcow2-linux-3d3fe3c05d5a17ebdf55b936c51017c127c0ed44.tar.gz
kernel-qcow2-linux-3d3fe3c05d5a17ebdf55b936c51017c127c0ed44.tar.xz
kernel-qcow2-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/rawnand.h')
-rw-r--r--include/linux/mtd/rawnand.h6
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,