diff options
author | Hou Zhiqiang <Zhiqiang.Hou@nxp.com> | 2017-03-17 16:12:31 +0800 |
---|---|---|
committer | York Sun <york.sun@nxp.com> | 2017-03-28 10:39:33 -0700 |
commit | 203db38a94a424bb1ab6a91e85148e8a8ea795d0 (patch) | |
tree | 153ab525078515afbf835638ee4bc2afb807cc0a | |
parent | d72158c045eacf5022b052bdc56a32bc98c89034 (diff) | |
download | u-boot-203db38a94a424bb1ab6a91e85148e8a8ea795d0.tar.gz u-boot-203db38a94a424bb1ab6a91e85148e8a8ea795d0.tar.bz2 u-boot-203db38a94a424bb1ab6a91e85148e8a8ea795d0.zip |
mtd: nand: remove nand size print from nand_init function
Add nand_size() function to move the nand size print into initr_nand().
Remove nand size print from nand_init() to allow other function to call
nand_init() without printing nand size.
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
-rw-r--r-- | common/board_r.c | 1 | ||||
-rw-r--r-- | drivers/mtd/nand/nand.c | 7 | ||||
-rw-r--r-- | include/nand.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/common/board_r.c b/common/board_r.c index 5c9e6987b9..3344913399 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -426,6 +426,7 @@ static int initr_nand(void) { puts("NAND: "); nand_init(); + printf("%lu MiB\n", nand_size() / 1024); return 0; } #endif diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c index 3ea2dcfb73..168bac6055 100644 --- a/drivers/mtd/nand/nand.c +++ b/drivers/mtd/nand/nand.c @@ -131,6 +131,11 @@ static void create_mtd_concat(void) } #endif +unsigned long nand_size(void) +{ + return total_nand_size; +} + void nand_init(void) { static int initialized; @@ -152,8 +157,6 @@ void nand_init(void) nand_init_chip(i); #endif - printf("%lu MiB\n", total_nand_size / 1024); - #ifdef CONFIG_SYS_NAND_SELECT_DEVICE /* * Select the chip in the board/cpu specific driver diff --git a/include/nand.h b/include/nand.h index b6eb223fb6..a86552878e 100644 --- a/include/nand.h +++ b/include/nand.h @@ -28,6 +28,7 @@ #endif extern void nand_init(void); +unsigned long nand_size(void); #include <linux/compat.h> #include <linux/mtd/mtd.h> |