Patchwork [v2,6/7] i2c-designware: use usleep_range() in the busy-loop

login
register
mail settings
Submitter Mika Westerberg
Date April 10, 2013, 10:36 a.m.
Message ID <1365590202-1623-6-git-send-email-mika.westerberg@linux.intel.com>
Download mbox | patch
Permalink /patch/235353/
State Accepted
Headers show

Comments

Mika Westerberg - April 10, 2013, 10:36 a.m.
This is not an atomic context so there is no need to use mdelay() but
instead use usleep_range().

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/i2c/busses/i2c-designware-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 5cc4ebf..7c10c5b 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -355,7 +355,7 @@  static int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev)
 			return -ETIMEDOUT;
 		}
 		timeout--;
-		mdelay(1);
+		usleep_range(1000, 1100);
 	}
 
 	return 0;