2021-03-02 20:24:10

by Md Sadre Alam

[permalink] [raw]
Subject: [PATCH] spi: qup: Change usleep_range to udelay

Change usleep_range() to udelay(). Since delay request
for 1 to 2 usec so we have to use udelay() instead of
usleep_range() as per kernel documentation.

Signed-off-by: Md Sadre Alam <[email protected]>
---
drivers/spi/spi-qup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 8dcb2e7..37b013f 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -189,7 +189,7 @@ static int spi_qup_set_state(struct spi_qup *controller, u32 state)
loop = 0;
while (!spi_qup_is_valid_state(controller)) {

- usleep_range(SPI_DELAY_THRESHOLD, SPI_DELAY_THRESHOLD * 2);
+ udelay(SPI_DELAY_THRESHOLD);

if (++loop > SPI_DELAY_RETRY)
return -EIO;
@@ -217,7 +217,7 @@ static int spi_qup_set_state(struct spi_qup *controller, u32 state)
loop = 0;
while (!spi_qup_is_valid_state(controller)) {

- usleep_range(SPI_DELAY_THRESHOLD, SPI_DELAY_THRESHOLD * 2);
+ udelay(SPI_DELAY_THRESHOLD);

if (++loop > SPI_DELAY_RETRY)
return -EIO;
--
2.7.4