diff mbox

[A,10/15] tidspbridge: remove udelay and use time_after instead

Message ID 1237339391-20543-11-git-send-email-felipe.contreras@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Felipe Contreras March 18, 2009, 1:23 a.m. UTC
From: Felipe Contreras <felipe.contreras@nokia.com>

As suggested by Juha Yrjola.

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
---
 drivers/dsp/bridge/wmd/tiomap_sm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/dsp/bridge/wmd/tiomap_sm.c b/drivers/dsp/bridge/wmd/tiomap_sm.c
index 658064f..735f8e9 100644
--- a/drivers/dsp/bridge/wmd/tiomap_sm.c
+++ b/drivers/dsp/bridge/wmd/tiomap_sm.c
@@ -105,7 +105,7 @@  DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 	u32 opplevel = 0;
 #endif
 	struct CFG_HOSTRES resources;
-	u16 cnt = 10;
+	unsigned long timeout;
 	u32 temp;
 	/* We are waiting indefinitely here. This needs to be fixed in the
 	 * second phase */
@@ -143,12 +143,12 @@  DSP_STATUS CHNLSM_InterruptDSP(struct WMD_DEV_CONTEXT *pDevContext)
 
 		pDevContext->dwBrdState = BRD_RUNNING;
 	}
+	timeout = jiffies + msecs_to_jiffies(10);
 	while (fifo_full((void __iomem *) resources.dwMboxBase, 0)) {
-		if (--cnt == 0) {
+		if (time_after(jiffies, timeout)) {
 			DBG_Trace(DBG_LEVEL7, "Timed out waiting for DSP mailbox \n");
 			return WMD_E_TIMEOUT;
 		}
-		mdelay(1);
 	}
 	DBG_Trace(DBG_LEVEL3, "writing %x to Mailbox\n",
 		  pDevContext->wIntrVal2Dsp);