staging: media: atomisp: use usleep_range instead of msleep for short delays
Subsystems (4)
PATCH v2 1/1 staging: media: atomisp: use usleep_range instead of msleep for short delays
The msleep() function is not precise for delays shorter than 20ms and can sleep for significantly longer than requested. Replacing it with usleep_range() improves accuracy and is the recommended practice according to documentation.
Signed-off-by Ramon Watson Vilar <[email protected]>
--- drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +1 -1
@@ -433,7 +433,7 @@ static int power_up(struct v4l2_subdev *sd) goto fail_power; } -msleep (5 ); +usleep_range (5000 ,10000 );return 0 ; fail_clk:
Signature · 1 line
2.53.0
Hi Ramon,
Quoted 15 lines · Ramon Watson Vilar
The
msleep()function is not precise for delays shorter than 20ms and can sleep for significantly longer than requested. Replacing it withusleep_range()improves accuracy and is the recommended practice according to documentation.Signed-off-by Ramon Watson Vilar <[email protected]>--- drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +0
-0
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c static int power_up(struct v4l2_subdev *sd) · line 436
Quoted 5 lines
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +1
-1@@ -433,7 +433,7 @@ static int power_up(struct v4l2_subdev *sd) goto fail_power; } -msleep (5 ); +usleep_range (5000 ,10000 );
A similar patch <[email protected]> has already been submitted.
Quoted 3 lines
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c +0
-0return 0 ; fail_clk:
Signature · 3 lines
Regards, Sakari Ailus