MTD: mxs_nand_spl: Redo the way nand_init initializes
authorAdam Ford <aford173@gmail.com>
Mon, 18 Feb 2019 23:58:17 +0000 (17:58 -0600)
committerStefano Babic <sbabic@denx.de>
Wed, 13 Mar 2019 08:14:35 +0000 (09:14 +0100)
commitd46d27d3b6558904b8fb44e90393f11c54ef3363
tree493cc9c0e3f9d8da050893d777aee97ccf6f0c30
parent8d0370905c61ce0390e04d2c7a0e7e7ac00d70d6
MTD: mxs_nand_spl: Redo the way nand_init initializes

Currently the spl system calls nand_init which does nothing.
It isn't until an attempt to load from NAND that it gets initialized.
Subsequent attempts to load just skip the initialization  because
NAND is already initialized.

This moves the contents of mxs_nand_init to nand_init.  In the event
of an error, it clears the number of nand chips found.  Any
attempts to use nand will check if there are nand chips available
instead of actually doing the initialization at that time. If there
are none, it will return an error to the higher level calls.

Signed-off-by: Adam Ford <aford173@gmail.com>
drivers/mtd/nand/raw/mxs_nand_spl.c