]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mtd: omap2: use msecs_to_jiffies()
authorToan Pham <tpham3783@gmail.com>
Fri, 15 Mar 2013 17:44:59 +0000 (10:44 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 5 Apr 2013 12:22:30 +0000 (13:22 +0100)
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@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/omap2.c

index b97ef3b68ec69f14a85180bcebc0897afcda6be8..81b80af55872a4f2481dd6d3d0c61b762e02ff51 100644 (file)
@@ -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)) {