diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2005-10-24 09:02:37 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-11-04 07:19:49 -0500 |
commit | 8433a509c0eb6bb1f33ce39c82c580b8901619ee (patch) | |
tree | f1554905dee5da4e840dfd674d5b004124496a22 /sound/pci/ymfpci/ymfpci_main.c | |
parent | d78bec210f07b06f406b877b9179e0cc281ae8e6 (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/ymfpci/ymfpci_main.c')
-rw-r--r-- | sound/pci/ymfpci/ymfpci_main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index a53117733d51..88a43e091d77 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -92,7 +92,7 @@ static int snd_ymfpci_codec_ready(ymfpci_t *chip, int secondary) | |||
92 | if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0) | 92 | if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0) |
93 | return 0; | 93 | return 0; |
94 | set_current_state(TASK_UNINTERRUPTIBLE); | 94 | set_current_state(TASK_UNINTERRUPTIBLE); |
95 | schedule_timeout(1); | 95 | schedule_timeout_uninterruptible(1); |
96 | } while (time_before(jiffies, end_time)); | 96 | } while (time_before(jiffies, end_time)); |
97 | snd_printk(KERN_ERR "codec_ready: codec %i is not ready [0x%x]\n", secondary, snd_ymfpci_readw(chip, reg)); | 97 | snd_printk(KERN_ERR "codec_ready: codec %i is not ready [0x%x]\n", secondary, snd_ymfpci_readw(chip, reg)); |
98 | return -EBUSY; | 98 | return -EBUSY; |
@@ -728,8 +728,7 @@ static void snd_ymfpci_irq_wait(ymfpci_t *chip) | |||
728 | init_waitqueue_entry(&wait, current); | 728 | init_waitqueue_entry(&wait, current); |
729 | add_wait_queue(&chip->interrupt_sleep, &wait); | 729 | add_wait_queue(&chip->interrupt_sleep, &wait); |
730 | atomic_inc(&chip->interrupt_sleep_count); | 730 | atomic_inc(&chip->interrupt_sleep_count); |
731 | set_current_state(TASK_UNINTERRUPTIBLE); | 731 | schedule_timeout_uninterruptible(msecs_to_jiffies(50)); |
732 | schedule_timeout(HZ/20); | ||
733 | remove_wait_queue(&chip->interrupt_sleep, &wait); | 732 | remove_wait_queue(&chip->interrupt_sleep, &wait); |
734 | } | 733 | } |
735 | } | 734 | } |