mtd: fsl_ifc_nand: use msecs_to_jiffies for time conversion
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Wed Apr 22 10:59:07 PDT 2015
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=95d706657311f24407d0f7a0cf79b55904ec6524
Commit: 95d706657311f24407d0f7a0cf79b55904ec6524
Parent: 41c7540d0c4e362212845aa2258c15aaa878665f
Author: Nicholas Mc Guire <hofrat at osadl.org>
AuthorDate: Fri Mar 13 07:23:47 2015 -0400
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Sun Apr 5 17:47:56 2015 -0700
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 <hofrat at osadl.org>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/nand/fsl_ifc_nand.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 4c05f4f..51394e5 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -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");
More information about the linux-mtd-cvs
mailing list