aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-11-11 13:37:58 +0100
committerJaroslav Kysela <perex@suse.cz>2004-11-11 13:37:58 +0100
commit6253c09c5191c1316c9d76b503538914ec49c16c (patch)
tree30c4801142577350be46275c699102cd749424f2 /sound
parent0b7c1313fd741da9e0a56cc5558b7b81e92e8b15 (diff)
downloadhistory-6253c09c5191c1316c9d76b503538914ec49c16c.tar.gz
[ALSA] replace schedule_timeout() with msleep()
SPARC cs4231 driver Uses msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/sparc/cs4231.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 9806b60367bb24..9bb20124741df5 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -560,7 +560,6 @@ static void snd_cs4231_mce_down(cs4231_t *chip)
{
unsigned long flags;
int timeout;
- signed long time;
spin_lock_irqsave(&chip->lock, flags);
snd_cs4231_busy_wait(chip);
@@ -594,29 +593,29 @@ static void snd_cs4231_mce_down(cs4231_t *chip)
#if 0
printk("(2) timeout = %i, jiffies = %li\n", timeout, jiffies);
#endif
- time = HZ / 4;
+ /* in 10ms increments, check condition, up to 250ms */
+ timeout = 25;
while (snd_cs4231_in(chip, CS4231_TEST_INIT) & CS4231_CALIB_IN_PROGRESS) {
spin_unlock_irqrestore(&chip->lock, flags);
- if (time <= 0) {
+ if (--timeout < 0) {
snd_printk("mce_down - auto calibration time out (2)\n");
return;
}
- set_current_state(TASK_INTERRUPTIBLE);
- time = schedule_timeout(time);
+ msleep(10);
spin_lock_irqsave(&chip->lock, flags);
}
#if 0
printk("(3) jiffies = %li\n", jiffies);
#endif
- time = HZ / 10;
+ /* in 10ms increments, check condition, up to 100ms */
+ timeout = 10;
while (__cs4231_readb(chip, CS4231P(chip, REGSEL)) & CS4231_INIT) {
spin_unlock_irqrestore(&chip->lock, flags);
- if (time <= 0) {
+ if (--timeout < 0) {
snd_printk("mce_down - auto calibration time out (3)\n");
return;
}
- set_current_state(TASK_INTERRUPTIBLE);
- time = schedule_timeout(time);
+ msleep(10);
spin_lock_irqsave(&chip->lock, flags);
}
spin_unlock_irqrestore(&chip->lock, flags);