]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
leds: sun50i-a100: Replace msleep() with usleep_range()
authorAbhishek Tamboli <abhishektamboli9@gmail.com>
Fri, 16 Aug 2024 17:11:29 +0000 (22:41 +0530)
committerLee Jones <lee@kernel.org>
Thu, 22 Aug 2024 10:39:47 +0000 (11:39 +0100)
Replace msleep() with usleep_range() in sun50i_a100_ledc_suspend()
to address the checkpatch.pl warning. msleep() for such short delay
can lead to inaccurate sleep times. Switch to usleep_range()
provide more precise delay.

Fix the following warning from checkpatch.pl:

WARNING: msleep < 20ms can sleep for up to 20ms;
see Documentation/timers/timers-howto.rst
+ msleep(1);

Signed-off-by: Abhishek Tamboli <abhishektamboli9@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20240816171129.6411-1-abhishektamboli9@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-sun50i-a100.c

index 119eff9471f054f325fa91f8a97bcf88208e1775..4c468d48748648ac38e83a227fa583e981964a4f 100644 (file)
@@ -368,7 +368,7 @@ static int sun50i_a100_ledc_suspend(struct device *dev)
                if (!xfer_active)
                        break;
 
-               msleep(1);
+               usleep_range(1000, 1100);
        }
 
        clk_disable_unprepare(priv->mod_clk);