diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-10-24 13:02:37 (GMT) |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-11-04 12:19:49 (GMT) |
commit | 8433a509c0eb6bb1f33ce39c82c580b8901619ee (patch) | |
tree | f1554905dee5da4e840dfd674d5b004124496a22 /sound/pci/ali5451 | |
parent | d78bec210f07b06f406b877b9179e0cc281ae8e6 (diff) | |
download | linux-8433a509c0eb6bb1f33ce39c82c580b8901619ee.tar.xz |
[ALSA] Fix schedule_timeout usage
Use schedule_timeout_{,un}interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use
human-time conversion functions instead of hard-coded division to avoid
rounding issues.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ali5451')
-rw-r--r-- | sound/pci/ali5451/ali5451.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index e336534..4e76c4a 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -398,10 +398,8 @@ static int snd_ali_codec_ready( ali_t *codec, res = snd_ali_5451_peek(codec,port); if (! (res & 0x8000)) return 0; - if (sched) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(1); - } + if (sched) + schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); snd_ali_5451_poke(codec, port, res & ~0x8000); snd_printdd("ali_codec_ready: codec is not ready.\n "); @@ -421,10 +419,8 @@ static int snd_ali_stimer_ready(ali_t *codec, int sched) dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); if (dwChk2 != dwChk1) return 0; - if (sched) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(1); - } + if (sched) + schedule_timeout_uninterruptible(1); } while (time_after_eq(end_time, jiffies)); snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); return -EIO; |