mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
authorNicholas Mc Guire <hofrat@osadl.org>
Fri, 13 Mar 2015 11:23:47 +0000 (07:23 -0400)
committerBrian Norris <computersforpeace@gmail.com>
Mon, 6 Apr 2015 00:47:56 +0000 (17:47 -0700)
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>
drivers/mtd/nand/fsl_ifc_nand.c

index 4c05f4f6a5c6a9a65040b3c4adc8f46cddc3d912..51394e59901bbc11704b3bb9c6d9c978247ee01f 100644 (file)
@@ -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)
@@ -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");