OSDN Git Service

mtd: rawnand: Allocate the interface configurations dynamically
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 29 May 2020 11:13:22 +0000 (13:13 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 26 Jun 2020 06:35:08 +0000 (08:35 +0200)
commit35b6bcc970f759d4a86d6221d09ca28ea20467c8
treee4fbcafb8ba76f30656658248fcf31097b469cd4
parenta69ad11168dca68b3f0adc6882422f4a2e2cb050
mtd: rawnand: Allocate the interface configurations dynamically

Instead of manipulating the statically allocated structure and copy
timings around, allocate one at identification time and save it in the
nand_chip structure once it has been initialized.

All NAND chips using the same interface configuration during reset and
startup, we define a helper to retrieve a single reset interface
configuration object, shared across all NAND chips.

We use a second pointer to always have a reference on the currently
applied interface configuration, which may either point to the "best
interface configuration" or to the "default reset interface
configuration".

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200529111322.7184-29-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/internals.h
drivers/mtd/nand/raw/nand_base.c
drivers/mtd/nand/raw/nand_timings.c
include/linux/mtd/rawnand.h