mtd: nand: remove nand size print from nand_init function
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Fri, 17 Mar 2017 08:12:31 +0000 (16:12 +0800)
committerYork Sun <york.sun@nxp.com>
Tue, 28 Mar 2017 17:39:33 +0000 (10:39 -0700)
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>
common/board_r.c
drivers/mtd/nand/nand.c
include/nand.h

index 5c9e6987b9e1a64f4b9fc43e53cd6bf06166860a..334491339914bc1ee97aaaf05bda7ea5e4feb5b9 100644 (file)
@@ -426,6 +426,7 @@ static int initr_nand(void)
 {
        puts("NAND:  ");
        nand_init();
+       printf("%lu MiB\n", nand_size() / 1024);
        return 0;
 }
 #endif
index 3ea2dcfb7378bd30fe8955d083737e96d27bcb27..168bac6055dea6be0b64ebcac20c0136f3e15bab 100644 (file)
@@ -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
index b6eb223fb6f3c34786e7f9af7415d14e41476656..a86552878e92064e61195495e9d9c96afd687aeb 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 
 extern void nand_init(void);
+unsigned long nand_size(void);
 
 #include <linux/compat.h>
 #include <linux/mtd/mtd.h>