[U-Boot-Users] [PATCH 18/26] Make nand_init() return the detected NAND size

Stelian Pop
2008-05-08T20:52:26Z

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 <stelian@popies.net>
---
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