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

login
register
mail settings
Submitter Mika Westerberg
Date March 21, 2013, 12:09 p.m.
Message ID <1363867800-23861-6-git-send-email-mika.westerberg@linux.intel.com>
Download mbox | patch
Permalink /patch/229644/
State Superseded
Headers show

Comments

Mika Westerberg - March 21, 2013, 12:09 p.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 0e4f531..0849648 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -350,7 +350,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;