Commit 4ff6772b5bb17ef40e64abf2c0d5f6aefd104b06

Authored by Toan Pham
Committed by David Woodhouse
1 parent 0c4a235cb3

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@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>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/mtd/nand/omap2.c
... ... @@ -1023,9 +1023,9 @@
1023 1023 int status, state = this->state;
1024 1024  
1025 1025 if (state == FL_ERASING)
1026   - timeo += (HZ * 400) / 1000;
  1026 + timeo += msecs_to_jiffies(400);
1027 1027 else
1028   - timeo += (HZ * 20) / 1000;
  1028 + timeo += msecs_to_jiffies(20);
1029 1029  
1030 1030 writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
1031 1031 while (time_before(jiffies, timeo)) {