[PATCH 2/4] rts5208: Fix usleep_range is preferred over udelay
From: Lukas Schneider
Date: Wed Jun 19 2019 - 11:59:11 EST
This patch fixes the issue reported by checkpatch:
CHECK: usleep_range is preferred over udelay;
see Documentation/timers/timers-howto.txt
It's save to sleep here instead of using busy waiting,
because we are not in an atomic context.
Signed-off-by: Lukas Schneider <lukas.s.schneider@xxxxxx>
Signed-off-by: Jannik Moritz <jannik.moritz@xxxxxx>
Cc <linux-kernel@xxxxxxxxxxxx>
---
drivers/staging/rts5208/rtsx_card.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/rts5208/rtsx_card.c b/drivers/staging/rts5208/rtsx_card.c
index 294f381518fa..960e845133c3 100644
--- a/drivers/staging/rts5208/rtsx_card.c
+++ b/drivers/staging/rts5208/rtsx_card.c
@@ -679,7 +679,7 @@ int switch_ssc_clock(struct rtsx_chip *chip, int clk)
if (retval < 0)
return STATUS_ERROR;
- udelay(10);
+ usleep_range(10, 20);
retval = rtsx_write_register(chip, CLK_CTL, CLK_LOW_FREQ, 0);
if (retval)
return retval;
@@ -797,7 +797,7 @@ int switch_normal_clock(struct rtsx_chip *chip, int clk)
return retval;
if (sd_vpclk_phase_reset) {
- udelay(200);
+ usleep_range(200, 210);
retval = rtsx_write_register(chip, SD_VPCLK0_CTL,
PHASE_NOT_RESET, PHASE_NOT_RESET);
if (retval)
@@ -806,7 +806,7 @@ int switch_normal_clock(struct rtsx_chip *chip, int clk)
PHASE_NOT_RESET, PHASE_NOT_RESET);
if (retval)
return retval;
- udelay(200);
+ usleep_range(200, 210);
}
retval = rtsx_write_register(chip, CLK_CTL, 0xFF, 0);
if (retval)
--
2.19.1