From 5c912cb1c31266c66ca59b36f9b6f87296421d75 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Sat, 7 Oct 2006 11:36:51 +0200 Subject: CFG_NAND_QUIET_TEST added to not warn upon missing NAND device Patch by Stefan Roese, 07 Oct 2006 --- drivers/nand/nand_base.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/nand/nand_base.c') diff --git a/drivers/nand/nand_base.c b/drivers/nand/nand_base.c index b7a5d32fb3..b0030857c6 100644 --- a/drivers/nand/nand_base.c +++ b/drivers/nand/nand_base.c @@ -2407,7 +2407,9 @@ int nand_scan (struct mtd_info *mtd, int maxchips) } if (!nand_flash_ids[i].name) { +#ifndef CFG_NAND_QUIET_TEST printk (KERN_WARNING "No NAND device found!!!\n"); +#endif this->select_chip(mtd, -1); return 1; } -- cgit v1.2.1 From 15784862857c3c2214498defcfed84ff137fb81e Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 27 Nov 2006 17:22:19 +0100 Subject: [PATCH] nand_wait() timeout fixes Two fixes for the nand_wait() function in drivers/nand/nand_base.c: 1. Use correct timeouts. The original timeouts in Linux source are 400ms and 20ms not 40s and 20s 2. Return correct error value in case of timeout. 0 is interpreted as OK. Signed-off-by: Rui Sousa Signed-off-by: Stefan Roese --- drivers/nand/nand_base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/nand/nand_base.c') diff --git a/drivers/nand/nand_base.c b/drivers/nand/nand_base.c index b7a5d32fb3..8237f4a8b3 100644 --- a/drivers/nand/nand_base.c +++ b/drivers/nand/nand_base.c @@ -838,9 +838,9 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state) unsigned long timeo; if (state == FL_ERASING) - timeo = CFG_HZ * 400; + timeo += (HZ * 400) / 1000; else - timeo = CFG_HZ * 20; + timeo += (HZ * 20) / 1000; if ((state == FL_ERASING) && (this->options & NAND_IS_AND)) this->cmdfunc(mtd, NAND_CMD_STATUS_MULTI, -1, -1); @@ -852,8 +852,8 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state) while (1) { if (get_timer(0) > timeo) { printf("Timeout!"); - return 0; - } + return 0x01; + } if (this->dev_ready) { if (this->dev_ready(mtd)) -- cgit v1.2.1