[PATCH] media: radio: si4713: replace msleep() with usleep_range() for delays less than 20ms

From: Bhoomika Hardwani

Date: Wed Aug 26 2026 - 07:14:35 EST


msleep() isn't precise for delays under 20ms and relies on jiffies, which
can lead to sleeps longer than requested, depending on the system's HZ
configurations.
Replace msleep(3) with usleep_range(3000, 4000) to use high-resolution
timers, without forcing the system to wait unnecessarily.

Signed-off-by: Bhoomika Hardwani <bhoomika.hardwani@xxxxxxxxx>
---
drivers/media/radio/si4713/radio-usb-si4713.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c
index 6e6764143e21..62877980fc04 100644
--- a/drivers/media/radio/si4713/radio-usb-si4713.c
+++ b/drivers/media/radio/si4713/radio-usb-si4713.c
@@ -192,7 +192,7 @@ static int si4713_send_startup_command(struct si4713_usb_device *radio)
}
if (time_is_before_jiffies(until_jiffies))
return -EIO;
- msleep(3);
+ usleep_range(3000, 4000);
}

return retval;
@@ -339,7 +339,7 @@ static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len)
data[0] = 0;
return 0;
}
- msleep(3);
+ usleep_range(3000, 4000);
}
}

--
2.34.1