diff mbox series

[1/2] NFC: st95hf: use msleep for long delay

Message ID 1554781699-42604-1-git-send-email-hofrat@opentech.at (mailing list archive)
State Deferred
Delegated to: Samuel Ortiz
Headers show
Series [1/2] NFC: st95hf: use msleep for long delay | expand

Commit Message

Nicholas Mc Guire April 9, 2019, 3:48 a.m. UTC
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@opentech.at>
---

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 mbox series

Patch

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;