Documentation/timers/timers-howto.txt recommends to use msleep_range() for delays less or equal 20ms. This driver use 10ms delays to talk with hardware, so let's follow the rules. Signed-off-by: Oleh Kravchenko <oleg@xxxxxxxxxx> --- drivers/leds/leds-cr0014114.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/leds/leds-cr0014114.c b/drivers/leds/leds-cr0014114.c index 0e4262462cb9..91deb40db307 100644 --- a/drivers/leds/leds-cr0014114.c +++ b/drivers/leds/leds-cr0014114.c @@ -37,7 +37,7 @@ /* CR0014114 default settings */ #define CR_MAX_BRIGHTNESS GENMASK(6, 0) -#define CR_FW_DELAY_MSEC 10 +#define CR_FW_DELAY_USEC 10000 #define CR_RECOUNT_DELAY (HZ * 3600) struct cr0014114_led { @@ -92,7 +92,7 @@ static int cr0014114_recount(struct cr0014114 *priv) cmd = CR_NEXT_REENUMERATE; for (i = 0; i < priv->count; i++) { - msleep(CR_FW_DELAY_MSEC); + usleep_range(CR_FW_DELAY_USEC, CR_FW_DELAY_USEC + 1); ret = spi_write(priv->spi, &cmd, sizeof(cmd)); if (ret) @@ -126,7 +126,7 @@ static int cr0014114_sync(struct cr0014114 *priv) goto err; priv->do_recount = false; - msleep(CR_FW_DELAY_MSEC); + usleep_range(CR_FW_DELAY_USEC, CR_FW_DELAY_USEC + 1); } priv->buf[0] = CR_SET_BRIGHTNESS; @@ -136,7 +136,7 @@ static int cr0014114_sync(struct cr0014114 *priv) ret = spi_write(priv->spi, priv->buf, priv->count + 2); err: - priv->delay = jiffies + msecs_to_jiffies(CR_FW_DELAY_MSEC); + priv->delay = jiffies + usecs_to_jiffies(CR_FW_DELAY_USEC); return ret; } @@ -252,7 +252,7 @@ static int cr0014114_probe(struct spi_device *spi) priv->dev = &spi->dev; priv->spi = spi; priv->delay = jiffies - - msecs_to_jiffies(CR_FW_DELAY_MSEC); + usecs_to_jiffies(CR_FW_DELAY_USEC); priv->do_recount = true; ret = cr0014114_sync(priv); -- 2.21.0