mtd: omap2: use msecs_to_jiffies()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Apr 5 08:59:14 EDT 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4ff6772b5bb17ef40e64abf2c0d5f6aefd104b06
Commit:     4ff6772b5bb17ef40e64abf2c0d5f6aefd104b06
Parent:     0c4a235cb3c6464fd1886101fa9a1be933e340dd
Author:     Toan Pham <tpham3783 at gmail.com>
AuthorDate: Fri Mar 15 10:44:59 2013 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Apr 5 13:22:30 2013 +0100

    mtd: omap2: use msecs_to_jiffies()
    
    Fix mtd-utils from returning -EIO. Formatting jffs2 filesystem was impossible
    when CONFIG_HZ was set to a low value.
    
    Signed-off-by: Toan Pham <tpham3783 at gmail.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/omap2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index b97ef3b..81b80af 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1023,9 +1023,9 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
 	int status, state = this->state;
 
 	if (state == FL_ERASING)
-		timeo += (HZ * 400) / 1000;
+		timeo += msecs_to_jiffies(400);
 	else
-		timeo += (HZ * 20) / 1000;
+		timeo += msecs_to_jiffies(20);
 
 	writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
 	while (time_before(jiffies, timeo)) {



More information about the linux-mtd-cvs mailing list