From 1d482c4ef16308d77ff4415714ec7b7bc3c2ecb1 Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Thu, 5 Nov 2009 23:01:46 -0500 Subject: Fix jiffies comparison Jiffies can wrap. We have to use macros to compare them. Signed-off-by: Nelson Castillo --- drivers/mfd/glamo/glamo-mci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c index 34bdbebb9db..faeb885c553 100644 --- a/drivers/mfd/glamo/glamo-mci.c +++ b/drivers/mfd/glamo/glamo-mci.c @@ -238,9 +238,10 @@ static int glamo_mci_wait_idle(struct glamo_mci_host *host, uint16_t status; do { status = glamo_reg_read(host, GLAMO_REG_MMC_RB_STAT1); - } while (!(status & GLAMO_STAT1_MMC_IDLE) && jiffies < timeout); + } while (!(status & GLAMO_STAT1_MMC_IDLE) && + time_is_after_jiffies(timeout)); - if (jiffies >= timeout) { + if (time_is_before_eq_jiffies(timeout)) { glamo_mci_reset(host); return -ETIMEDOUT; } -- cgit v1.2.3