• Miquel Raynal's avatar
    mtd: nand: provide valid ->data_interface during NAND detection · 17fa8044
    Miquel Raynal authored
    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: default avatarMiquel Raynal <miquel.raynal@free-electrons.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    17fa8044
nand_timings.c 7.07 KB