From 8433a509c0eb6bb1f33ce39c82c580b8901619ee Mon Sep 17 00:00:00 2001 From: Nishanth Aravamudan Date: Mon, 24 Oct 2005 15:02:37 +0200 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Takashi Iwai --- sound/pci/maestro3.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'sound/pci/maestro3.c') diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index ad77b414582..99eb76c56f8 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -2046,8 +2046,7 @@ static void snd_m3_ac97_reset(m3_t *chip) outw(0, io + GPIO_DATA); outw(dir | GPO_PRIMARY_AC97, io + GPIO_DIRECTION); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout((delay1 * HZ) / 1000); + schedule_timeout_uninterruptible(msecs_to_jiffies(delay1)); outw(GPO_PRIMARY_AC97, io + GPIO_DATA); udelay(5); @@ -2055,8 +2054,7 @@ static void snd_m3_ac97_reset(m3_t *chip) outw(IO_SRAM_ENABLE | SERIAL_AC_LINK_ENABLE, io + RING_BUS_CTRL_A); outw(~0, io + GPIO_MASK); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout((delay2 * HZ) / 1000); + schedule_timeout_uninterruptible(msecs_to_jiffies(delay2)); if (! snd_m3_try_read_vendor(chip)) break; @@ -2101,8 +2099,7 @@ static int __devinit snd_m3_mixer(m3_t *chip) /* seems ac97 PCM needs initialization.. hack hack.. */ snd_ac97_write(chip->ac97, AC97_PCM, 0x8000 | (15 << 8) | 15); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 10); + schedule_timeout_uninterruptible(msecs_to_jiffies(100)); snd_ac97_write(chip->ac97, AC97_PCM, 0); memset(&id, 0, sizeof(id)); -- cgit v1.2.3