summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@kernel.org>2025-04-18 23:16:31 +0200
committerAndi Shyti <andi@smida.it>2025-05-19 22:23:56 +0200
commit9f64de0f8522ec5b2d3208b6d3b47e8b8a0f0c3c (patch)
tree89710efb77f374a4e0d595607f3f4ac49a3cd070
parenteb9b9b1e193e93da38b4773d90686cc7ffb077ec (diff)
i2c: iproc: Replace udelay() with usleep_range()
Replace udelay(100) with usleep_range(100, 200) as recommended by kernel documentation. The delay is not in atomic context, so busy-waiting is unnecessary. Also update the comment for clarity. Link: https://lore.kernel.org/r/20250418211635.2666234-7-andi.shyti@kernel.org Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
-rw-r--r--drivers/i2c/busses/i2c-bcm-iproc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index 44083698121a..2e04ea157e8e 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -276,8 +276,8 @@ static void bcm_iproc_i2c_slave_init(
val |= BIT(CFG_RESET_SHIFT);
iproc_i2c_wr_reg(iproc_i2c, CFG_OFFSET, val);
- /* wait 100 usec per spec */
- udelay(100);
+ /* wait approximately 100 usec as per spec */
+ usleep_range(100, 200);
/* bring controller out of reset */
val &= ~(BIT(CFG_RESET_SHIFT));
@@ -687,8 +687,8 @@ static void bcm_iproc_i2c_init(struct bcm_iproc_i2c_dev *iproc_i2c)
val &= ~(BIT(CFG_EN_SHIFT));
iproc_i2c_wr_reg(iproc_i2c, CFG_OFFSET, val);
- /* wait 100 usec per spec */
- udelay(100);
+ /* wait approximately 100 usec as per spec */
+ usleep_range(100, 200);
/* bring controller out of reset */
val &= ~(BIT(CFG_RESET_SHIFT));