Skip to content

Commit 95d7066

Browse files
Nicholas Mc Guirecomputersforpeace
authored andcommitted
mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
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 <[email protected]> Signed-off-by: Brian Norris <[email protected]>
1 parent 41c7540 commit 95d7066

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mtd/nand/fsl_ifc_nand.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ static void fsl_ifc_run_command(struct mtd_info *mtd)
317317

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

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

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

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

0 commit comments

Comments
 (0)