Skip to content

Commit

Permalink
mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
Browse files Browse the repository at this point in the history
This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var) which helps readability
and also handles all corner-cases properly.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Nicholas Mc Guire authored and Brian Norris committed Apr 6, 2015
1 parent 41c7540 commit 95d7066
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/nand/fsl_ifc_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)

/* wait for command complete flag or timeout */
wait_event_timeout(ctrl->nand_wait, ctrl->nand_stat,
IFC_TIMEOUT_MSECS * HZ/1000);
msecs_to_jiffies(IFC_TIMEOUT_MSECS));

/* ctrl->nand_stat will be updated from IRQ context */
if (!ctrl->nand_stat)
Expand Down Expand Up @@ -860,7 +860,7 @@ static void fsl_ifc_sram_init(struct fsl_ifc_mtd *priv)

/* wait for command complete flag or timeout */
wait_event_timeout(ctrl->nand_wait, ctrl->nand_stat,
IFC_TIMEOUT_MSECS * HZ/1000);
msecs_to_jiffies(IFC_TIMEOUT_MSECS));

if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
printk(KERN_ERR "fsl-ifc: Failed to Initialise SRAM\n");
Expand Down

0 comments on commit 95d7066

Please sign in to comment.