This patch modifies the nand_init() routine and makes it return the
total detected NAND size, since this information can be useful to the
caller.

Signed-off-by: Stelian Pop <[EMAIL PROTECTED]>
---
 drivers/mtd/nand/nand.c |    3 ++-
 include/nand.h          |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 27b5792..c5746fe 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -60,7 +60,7 @@ static void nand_init_chip(struct mtd_info *mtd, struct 
nand_chip *nand,
 
 }
 
-void nand_init(void)
+ulong nand_init(void)
 {
        int i;
        unsigned int size = 0;
@@ -78,6 +78,7 @@ void nand_init(void)
         */
        board_nand_select_device(nand_info[nand_curr_device].priv, 
nand_curr_device);
 #endif
+       return size;
 }
 
 #endif
diff --git a/include/nand.h b/include/nand.h
index 247d346..8f388c4 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -32,7 +32,7 @@ typedef struct mtd_info nand_info_t;
 
 extern int nand_curr_device;
 extern nand_info_t nand_info[];
-extern void nand_init(void);
+extern ulong nand_init(void);
 
 static inline int nand_read(nand_info_t *info, off_t ofs, size_t *len, u_char 
*buf)
 {
-- 
1.5.3.3


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to