Commit 4ff6772b authored by Toan Pham's avatar Toan Pham Committed by David Woodhouse
Browse files

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: default avatarToan Pham <tpham3783@gmail.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 0c4a235c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1023,9 +1023,9 @@ static int omap_wait(struct mtd_info *mtd, struct nand_chip *chip)
	int status, state = this->state;
	int status, state = this->state;


	if (state == FL_ERASING)
	if (state == FL_ERASING)
		timeo += (HZ * 400) / 1000;
		timeo += msecs_to_jiffies(400);
	else
	else
		timeo += (HZ * 20) / 1000;
		timeo += msecs_to_jiffies(20);


	writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
	writeb(NAND_CMD_STATUS & 0xFF, info->reg.gpmc_nand_command);
	while (time_before(jiffies, timeo)) {
	while (time_before(jiffies, timeo)) {