Skip to content

Commit 9f64de0

Browse files
Andi ShytiAndi Shyti
authored andcommitted
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>
1 parent eb9b9b1 commit 9f64de0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/i2c/busses/i2c-bcm-iproc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ static void bcm_iproc_i2c_slave_init(
276276
val |= BIT(CFG_RESET_SHIFT);
277277
iproc_i2c_wr_reg(iproc_i2c, CFG_OFFSET, val);
278278

279-
/* wait 100 usec per spec */
280-
udelay(100);
279+
/* wait approximately 100 usec as per spec */
280+
usleep_range(100, 200);
281281

282282
/* bring controller out of reset */
283283
val &= ~(BIT(CFG_RESET_SHIFT));
@@ -687,8 +687,8 @@ static void bcm_iproc_i2c_init(struct bcm_iproc_i2c_dev *iproc_i2c)
687687
val &= ~(BIT(CFG_EN_SHIFT));
688688
iproc_i2c_wr_reg(iproc_i2c, CFG_OFFSET, val);
689689

690-
/* wait 100 usec per spec */
691-
udelay(100);
690+
/* wait approximately 100 usec as per spec */
691+
usleep_range(100, 200);
692692

693693
/* bring controller out of reset */
694694
val &= ~(BIT(CFG_RESET_SHIFT));

0 commit comments

Comments
 (0)