[PATCH 1/2] NFC: st95hf: use msleep for long delay
From: Nicholas Mc Guire
Date: Mon Apr 08 2019 - 23:48:48 EST
usleep_ranges is backed by hrtimers - for a delay of 50ms
notably in a loop using a hrtimer is of no benefit and
msleep() should be fine here (see
Documentation/timers/timers-howto.txt).
Signed-off-by: Nicholas Mc Guire <hofrat@xxxxxxxxxxx>
---
Problem located with an experimental coccinelle script
Patch was compile tested with: x86_64_defconfig + SPI=y,
NFC=y, NFC_DIGITAL=y, NFC_ST95HF=m
Patch is against 5.1-rc3 (localversion-next is -next-20190408)
drivers/nfc/st95hf/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index a50a95c..34bf1d7 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -535,7 +535,7 @@ static int st95hf_por_sequence(struct st95hf_context *st95context)
st95hf_send_spi_reset_sequence(st95context);
/* delay of 50 milisecond */
- usleep_range(50000, 51000);
+ msleep(50);
} while (nth_attempt++ < 3);
return -ETIMEDOUT;
--
2.1.4