]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: provide valid ->data_interface during NAND detection
authorMiquel Raynal <miquel.raynal@free-electrons.com>
Thu, 30 Nov 2017 17:01:31 +0000 (18:01 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 14 Dec 2017 12:34:18 +0000 (13:34 +0100)
commit6c3e3c768a022c4686a5eb2b9538929db6da379c
tree09862c411942ba7b4c62035c11a5b702b736371f
parent2f1975e229f0f9fbd07635b666f1bac13e97cf81
mtd: nand: provide valid ->data_interface during NAND detection

Right now, the chip->data_interface field is populated in
nand_scan_tail(), so after the whole NAND detection has taken place.
This is fine because these timings are not yet used by the core so
early in the probe process, but the situation is about to change with
the introduction of ->exec_op().

Also, by convention, nand_scan_ident() is not supposed to allocate
resources, only nand_scan_tail() can, so this prevent us from
allocating and initializing the data_interface object in
nand_scan_ident().

In order to solve this problem, directly embed a data_interface object
in nand_chip so that we don't have to allocate it, and initialize it to
ONFI SDR mode 0 at the very beginning of nand_scan_ident().

Signed-off-by: Miquel Raynal <miquel.raynal@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_timings.c
include/linux/mtd/rawnand.h