aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ali5451/ali5451.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2005-10-24 09:02:37 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:19:49 -0500
commit8433a509c0eb6bb1f33ce39c82c580b8901619ee (patch)
treef1554905dee5da4e840dfd674d5b004124496a22 /sound/pci/ali5451/ali5451.c
parentd78bec210f07b06f406b877b9179e0cc281ae8e6 (diff)
[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/ali5451.c')
-rw-r--r--sound/pci/ali5451/ali5451.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c
index e33653439cb5..4e76c4a636d9 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,
398 res = snd_ali_5451_peek(codec,port); 398 res = snd_ali_5451_peek(codec,port);
399 if (! (res & 0x8000)) 399 if (! (res & 0x8000))
400 return 0; 400 return 0;
401 if (sched) { 401 if (sched)
402 set_current_state(TASK_UNINTERRUPTIBLE); 402 schedule_timeout_uninterruptible(1);
403 schedule_timeout(1);
404 }
405 } while (time_after_eq(end_time, jiffies)); 403 } while (time_after_eq(end_time, jiffies));
406 snd_ali_5451_poke(codec, port, res & ~0x8000); 404 snd_ali_5451_poke(codec, port, res & ~0x8000);
407 snd_printdd("ali_codec_ready: codec is not ready.\n "); 405 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)
421 dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER); 419 dwChk2 = snd_ali_5451_peek(codec, ALI_STIMER);
422 if (dwChk2 != dwChk1) 420 if (dwChk2 != dwChk1)
423 return 0; 421 return 0;
424 if (sched) { 422 if (sched)
425 set_current_state(TASK_UNINTERRUPTIBLE); 423 schedule_timeout_uninterruptible(1);
426 schedule_timeout(1);
427 }
428 } while (time_after_eq(end_time, jiffies)); 424 } while (time_after_eq(end_time, jiffies));
429 snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n"); 425 snd_printk(KERN_ERR "ali_stimer_read: stimer is not ready.\n");
430 return -EIO; 426 return -EIO;