[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>
This commit is contained in:

committed by
Jaroslav Kysela

parent
d78bec210f
commit
8433a509c0
@@ -92,7 +92,7 @@ static int snd_ymfpci_codec_ready(ymfpci_t *chip, int secondary)
|
||||
if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0)
|
||||
return 0;
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
schedule_timeout(1);
|
||||
schedule_timeout_uninterruptible(1);
|
||||
} while (time_before(jiffies, end_time));
|
||||
snd_printk(KERN_ERR "codec_ready: codec %i is not ready [0x%x]\n", secondary, snd_ymfpci_readw(chip, reg));
|
||||
return -EBUSY;
|
||||
@@ -728,8 +728,7 @@ static void snd_ymfpci_irq_wait(ymfpci_t *chip)
|
||||
init_waitqueue_entry(&wait, current);
|
||||
add_wait_queue(&chip->interrupt_sleep, &wait);
|
||||
atomic_inc(&chip->interrupt_sleep_count);
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
schedule_timeout(HZ/20);
|
||||
schedule_timeout_uninterruptible(msecs_to_jiffies(50));
|
||||
remove_wait_queue(&chip->interrupt_sleep, &wait);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user