Skip to content

Commit

Permalink
mtd: omap2: use msecs_to_jiffies()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Toan Pham authored and David Woodhouse committed Apr 5, 2013
1 parent 0c4a235 commit 4ff6772
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 4ff6772

Please sign in to comment.