From: Xiubo Li <lixiubo@cmss.chinamobile.com>
To: broonie@kernel.org
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Xiubo Li <lixiubo@cmss.chinamobile.com>
Subject: [PATCH 2/2] ASoC: fsl-mpc5200: Use usleep_range() instead of msleep()
Date: Fri, 15 Jan 2016 19:35:25 +0800 [thread overview]
Message-ID: <1452857725-32414-3-git-send-email-lixiubo@cmss.chinamobile.com> (raw)
In-Reply-To: <1452857725-32414-1-git-send-email-lixiubo@cmss.chinamobile.com>
Since msleep() will sleep longer than intended time for values less
than 20ms, this patch allows the use of usleep_range for just 1ms.
usleep_range is a finer precision implementation of msleep and is
designed to be a drop-in replacement for udelay where a precise
sleep/busy-wait is unnecessary.
More details see Documentation/timers/timers-howto.txt.
Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
sound/soc/fsl/mpc5200_psc_ac97.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c
index 0bab760..243700c 100644
--- a/sound/soc/fsl/mpc5200_psc_ac97.c
+++ b/sound/soc/fsl/mpc5200_psc_ac97.c
@@ -13,6 +13,7 @@
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/delay.h>
+#include <linux/time.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -127,7 +128,7 @@ static void psc_ac97_cold_reset(struct snd_ac97 *ac97)
mutex_unlock(&psc_dma->mutex);
- msleep(1);
+ usleep_range(1000, 2000);
psc_ac97_warm_reset(ac97);
}
--
1.8.3.1
prev parent reply other threads:[~2016-01-15 11:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 11:35 [PATCH 0/2] ASoC: fsl: Use usleep_range() instead of msleep() Xiubo Li
2016-01-15 11:35 ` [PATCH 1/2] ASoC: fsl_sai: " Xiubo Li
2016-01-22 16:48 ` Mark Brown
2016-01-15 11:35 ` Xiubo Li [this message]
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=1452857725-32414-3-git-send-email-lixiubo@cmss.chinamobile.com \
--to=lixiubo@cmss.chinamobile.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).