From patchwork Sat Jun 27 05:37:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [MTD,NAND] : fix omap2.c compile failure and warning Date: Fri, 26 Jun 2009 19:37:06 -0000 From: Singh, Vimal X-Patchwork-Id: 29225 > The 'status' you return in the case that you _have_ gone through the > loop is still wrong though, isn't it? Yes, I have corrected that in below patch. Its my bad, I did not fix it previously. Signed-off-by: Vimal Singh Signed-off-by: Ming Lei --- diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index 0cd76f8..3b6e6ad 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include #include #include @@ -541,7 +543,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip struct omap_nand_info *info = container_of(mtd, struct omap_nand_info, mtd); unsigned long timeo = jiffies; - int status, state = this->state; + int status = NAND_STATUS_FAIL, state = this->state; if (state == FL_ERASING) timeo += (HZ * 400) / 1000; @@ -558,6 +560,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip status = __raw_readb(this->IO_ADDR_R); - if (!(status & 0x40)) + if (status & NAND_STATUS_READY) break; + cond_resched(); } return status; }