Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH] staging: nvec: replace udelay with usleep_range
@ 2025-12-24 11:16 ShadowMonkee
  2025-12-24 12:02 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: ShadowMonkee @ 2025-12-24 11:16 UTC (permalink / raw)
  To: Marc Dietrich, Greg Kroah-Hartman
  Cc: ac100, linux-tegra, linux-staging, linux-kernel, ShadowMonkee

udelay() was used for a short delay in the NVEC I2C receive path.
Replace it with usleep_range(), which is preferred as it avoids
busy-waiting and allows the scheduler to run other tasks.

Signed-off-by: ShadowMonkee <sshadowmonkeyy@gmail.com>
---
 drivers/staging/nvec/nvec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 263774e6a78c..dd92f186e0db 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -648,7 +648,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		break;
 	case 2:		/* first byte after command */
 		if (status == (I2C_SL_IRQ | RNW | RCVD)) {
-			udelay(33);
+			usleep_range(33, 34);
 			if (nvec->rx->data[0] != 0x01) {
 				dev_err(nvec->dev,
 					"Read without prior read command\n");
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-24 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-24 11:16 [PATCH] staging: nvec: replace udelay with usleep_range ShadowMonkee
2025-12-24 12:02 ` Greg Kroah-Hartman
2025-12-24 14:32   ` Marc Dietrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox