From: Lukas Schneider <lukas.s.schneider@fau.de>
To: kim.jamie.bradley@gmail.com, pakki001@umn.edu,
colin.king@canonical.com, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Cc: Lukas Schneider <lukas.s.schneider@fau.de>,
Jannik Moritz <jannik.moritz@fau.de>
Subject: [PATCH 2/4] rts5208: Fix usleep_range is preferred over udelay
Date: Wed, 19 Jun 2019 17:46:46 +0200 [thread overview]
Message-ID: <20190619154648.13840-2-lukas.s.schneider@fau.de> (raw)
In-Reply-To: <20190619154648.13840-1-lukas.s.schneider@fau.de>
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@fau.de>
Signed-off-by: Jannik Moritz <jannik.moritz@fau.de>
Cc <linux-kernel@i4.cs.fau.de>
---
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
next prev parent reply other threads:[~2019-06-19 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 15:46 [PATCH 1/4] " Lukas Schneider
2019-06-19 15:46 ` Lukas Schneider [this message]
2019-06-19 15:46 ` [PATCH 3/4] " Lukas Schneider
2019-06-19 15:46 ` [PATCH 4/4] rts5208: Fix usleep range " Lukas Schneider
2019-06-21 11:04 ` Pavel Machek
2019-06-21 13:01 ` Lukas Schneider
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190619154648.13840-2-lukas.s.schneider@fau.de \
--to=lukas.s.schneider@fau.de \
--cc=colin.king@canonical.com \
--cc=devel@driverdev.osuosl.org \
--cc=jannik.moritz@fau.de \
--cc=kim.jamie.bradley@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pakki001@umn.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®