* [PATCH] staging: atomisp: replace msleep with usleep_range in atomisp-gc2235.c
@ 2026-03-09 23:14 Oskar Ray-Frayssinet
2026-03-10 11:43 ` Andy Shevchenko
2026-03-10 15:03 ` [PATCH v2] staging: media: atomisp: replace msleep() with fsleep() " Oskar Ray-Frayssinet
0 siblings, 2 replies; 3+ messages in thread
From: Oskar Ray-Frayssinet @ 2026-03-09 23:14 UTC (permalink / raw)
To: hansg, mchehab
Cc: sakari.ailus, andy, gregkh, linux-media, linux-staging,
linux-kernel, Oskar Ray-Frayssinet
Replace msleep(5) with usleep_range(5000, 6000) to avoid sleeping
longer than necessary. msleep() with values less than 20ms may sleep
for up to 20ms due to timer granularity.
Signed-off-by: Oskar Ray-Frayssinet <rayfraytech@gmail.com>
---
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index d3414312e1de..db5e007efc56 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -433,7 +433,7 @@ static int power_up(struct v4l2_subdev *sd)
goto fail_power;
}
- msleep(5);
+ usleep_range(5000, 6000);
return 0;
fail_clk:
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: atomisp: replace msleep with usleep_range in atomisp-gc2235.c
2026-03-09 23:14 [PATCH] staging: atomisp: replace msleep with usleep_range in atomisp-gc2235.c Oskar Ray-Frayssinet
@ 2026-03-10 11:43 ` Andy Shevchenko
2026-03-10 15:03 ` [PATCH v2] staging: media: atomisp: replace msleep() with fsleep() " Oskar Ray-Frayssinet
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-03-10 11:43 UTC (permalink / raw)
To: Oskar Ray-Frayssinet
Cc: hansg, mchehab, sakari.ailus, andy, gregkh, linux-media,
linux-staging, linux-kernel
On Tue, Mar 10, 2026 at 12:14:45AM +0100, Oskar Ray-Frayssinet wrote:
> Replace msleep(5) with usleep_range(5000, 6000) to avoid sleeping
> longer than necessary. msleep() with values less than 20ms may sleep
> for up to 20ms due to timer granularity.
Use () in Subject, use fsleep() in the code.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] staging: media: atomisp: replace msleep() with fsleep() in atomisp-gc2235.c
2026-03-09 23:14 [PATCH] staging: atomisp: replace msleep with usleep_range in atomisp-gc2235.c Oskar Ray-Frayssinet
2026-03-10 11:43 ` Andy Shevchenko
@ 2026-03-10 15:03 ` Oskar Ray-Frayssinet
1 sibling, 0 replies; 3+ messages in thread
From: Oskar Ray-Frayssinet @ 2026-03-10 15:03 UTC (permalink / raw)
To: hansg, mchehab
Cc: sakari.ailus, andy, gregkh, linux-media, linux-staging,
linux-kernel, Oskar Ray-Frayssinet
Replace msleep(5) with fsleep(5000) to avoid sleeping longer than
necessary. msleep() with values less than 20ms may sleep for up to
20ms due to timer granularity. fsleep() selects the appropriate sleep
function automatically.
Signed-off-by: Oskar Ray-Frayssinet <rayfraytech@gmail.com>
---
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index d3414312e1de..7999c8595a68 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -433,7 +433,7 @@ static int power_up(struct v4l2_subdev *sd)
goto fail_power;
}
- msleep(5);
+ fsleep(5000);
return 0;
fail_clk:
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-10 15:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 23:14 [PATCH] staging: atomisp: replace msleep with usleep_range in atomisp-gc2235.c Oskar Ray-Frayssinet
2026-03-10 11:43 ` Andy Shevchenko
2026-03-10 15:03 ` [PATCH v2] staging: media: atomisp: replace msleep() with fsleep() " Oskar Ray-Frayssinet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox