diff mbox

[MTD,NAND] : fix omap2.c compile failure and warning

Message ID 57946.192.168.10.89.1246035773.squirrel@dbdmail.itg.ti.com
State New, archived
Headers show

Commit Message

Singh, Vimal June 26, 2009, 5:02 p.m. UTC
Somehow I do not see below errors on compilation:
drivers/mtd/nand/omap2.c: In function 'omap_wait':
drivers/mtd/nand/omap2.c:543: error: 'jiffies' undeclared (first use in this
function)
drivers/mtd/nand/omap2.c:543: error: (Each undeclared identifier is reported
only once
drivers/mtd/nand/omap2.c:543: error: for each function it appears in.)
drivers/mtd/nand/omap2.c:557: error: implicit declaration of function
'time_before'

But still including 'linux/jiffies.h'.

Below is the patch.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---

drivers/mtd/nand/omap2.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

 		timeo += (HZ * 400) / 1000;
@@ -558,6 +560,7 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip
*chip)
 		status = __raw_readb(this->IO_ADDR_R);
 		if (!(status & 0x40))
 			break;
+		cond_resched();
 	}
 	return status;
 }

Comments

David Woodhouse June 26, 2009, 5:14 p.m. UTC | #1
On Fri, 2009-06-26 at 22:32 +0530, vimal singh wrote:
> Somehow I do not see below errors on compilation:
> drivers/mtd/nand/omap2.c: In function 'omap_wait':
> drivers/mtd/nand/omap2.c:543: error: 'jiffies' undeclared (first use in this
> function)
> drivers/mtd/nand/omap2.c:543: error: (Each undeclared identifier is reported
> only once
> drivers/mtd/nand/omap2.c:543: error: for each function it appears in.)
> drivers/mtd/nand/omap2.c:557: error: implicit declaration of function
> 'time_before'
> 
> But still including 'linux/jiffies.h'.
> 
> Below is the patch.

The 'status' you return in the case that you _have_ gone through the
loop is still wrong though, isn't it?
diff mbox

Patch

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 <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/delay.h>
+#include <linux/jiffies.h>
+#include <linux/sched.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -541,7 +543,7 @@  static int omap_wait(struct mtd_info *mtd, struct nand_chip
*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)