From e3fe42b149c4c8ee13ade4112ed38e6d9a85c7b7 Mon Sep 17 00:00:00 2001 From: Vaishali Thakkar Date: Fri, 3 Oct 2014 09:16:53 +0530 Subject: [PATCH] Staging: iio: adc: Refine delay computation As per comment in function ad7280_delay, conversion delay may take up to 250us. We cannot rely on msleep for this because it may sleep longer than intended time for values less than 20ms, so use usleep_range instead. Problem detected using checkpatch.pl. Signed-off-by: Vaishali Thakkar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/adc/ad7280a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index d215edf..4d48707 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -188,7 +188,7 @@ static void ad7280_delay(struct ad7280_state *st) if (st->readback_delay_us < 50) udelay(st->readback_delay_us); else - msleep(1); + usleep_range(250, 500); } static int __ad7280_read32(struct ad7280_state *st, unsigned *val) -- 2.7.4