diff options
author | Wolfgang Denk <wd@denx.de> | 2006-12-24 01:30:04 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2006-12-24 01:30:04 +0100 |
commit | bc5556d62b6ebe6cb4302aebec9e7bbf1affd2ea (patch) | |
tree | bcb2fa6abc6e2b2ed36a06cd77bb7f869abbe92f /drivers/nand | |
parent | 1b3c360c235dc684ec06c2d5f183f0a282ce45e2 (diff) | |
parent | fa23044564091f05d9695beb7b5b9a931e7f41a4 (diff) | |
download | u-boot-imx-bc5556d62b6ebe6cb4302aebec9e7bbf1affd2ea.zip u-boot-imx-bc5556d62b6ebe6cb4302aebec9e7bbf1affd2ea.tar.gz u-boot-imx-bc5556d62b6ebe6cb4302aebec9e7bbf1affd2ea.tar.bz2 |
Merge with /home/hs/TQ/u-boot-dev
Diffstat (limited to 'drivers/nand')
-rw-r--r-- | drivers/nand/nand.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/nand/nand.c b/drivers/nand/nand.c index 3899045..9fef71d 100644 --- a/drivers/nand/nand.c +++ b/drivers/nand/nand.c @@ -39,7 +39,7 @@ static ulong base_address[CFG_MAX_NAND_DEVICE] = CFG_NAND_BASE_LIST; static const char default_nand_name[] = "nand"; -extern void board_nand_init(struct nand_chip *nand); +extern int board_nand_init(struct nand_chip *nand); static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand, ulong base_addr) @@ -47,13 +47,16 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand, mtd->priv = nand; nand->IO_ADDR_R = nand->IO_ADDR_W = (void __iomem *)base_addr; - board_nand_init(nand); - - if (nand_scan(mtd, 1) == 0) { - if (!mtd->name) - mtd->name = (char *)default_nand_name; - } else + if (board_nand_init(nand) == 0) { + if (nand_scan(mtd, 1) == 0) { + if (!mtd->name) + mtd->name = (char *)default_nand_name; + } else + mtd->name = NULL; + } else { mtd->name = NULL; + mtd->size = 0; + } } |