aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.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/maestro3.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/maestro3.c')
-rw-r--r--sound/pci/maestro3.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index ad77b4145824..99eb76c56f81 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2046,8 +2046,7 @@ static void snd_m3_ac97_reset(m3_t *chip)
2046 outw(0, io + GPIO_DATA); 2046 outw(0, io + GPIO_DATA);
2047 outw(dir | GPO_PRIMARY_AC97, io + GPIO_DIRECTION); 2047 outw(dir | GPO_PRIMARY_AC97, io + GPIO_DIRECTION);
2048 2048
2049 set_current_state(TASK_UNINTERRUPTIBLE); 2049 schedule_timeout_uninterruptible(msecs_to_jiffies(delay1));
2050 schedule_timeout((delay1 * HZ) / 1000);
2051 2050
2052 outw(GPO_PRIMARY_AC97, io + GPIO_DATA); 2051 outw(GPO_PRIMARY_AC97, io + GPIO_DATA);
2053 udelay(5); 2052 udelay(5);
@@ -2055,8 +2054,7 @@ static void snd_m3_ac97_reset(m3_t *chip)
2055 outw(IO_SRAM_ENABLE | SERIAL_AC_LINK_ENABLE, io + RING_BUS_CTRL_A); 2054 outw(IO_SRAM_ENABLE | SERIAL_AC_LINK_ENABLE, io + RING_BUS_CTRL_A);
2056 outw(~0, io + GPIO_MASK); 2055 outw(~0, io + GPIO_MASK);
2057 2056
2058 set_current_state(TASK_UNINTERRUPTIBLE); 2057 schedule_timeout_uninterruptible(msecs_to_jiffies(delay2));
2059 schedule_timeout((delay2 * HZ) / 1000);
2060 2058
2061 if (! snd_m3_try_read_vendor(chip)) 2059 if (! snd_m3_try_read_vendor(chip))
2062 break; 2060 break;
@@ -2101,8 +2099,7 @@ static int __devinit snd_m3_mixer(m3_t *chip)
2101 2099
2102 /* seems ac97 PCM needs initialization.. hack hack.. */ 2100 /* seems ac97 PCM needs initialization.. hack hack.. */
2103 snd_ac97_write(chip->ac97, AC97_PCM, 0x8000 | (15 << 8) | 15); 2101 snd_ac97_write(chip->ac97, AC97_PCM, 0x8000 | (15 << 8) | 15);
2104 set_current_state(TASK_UNINTERRUPTIBLE); 2102 schedule_timeout_uninterruptible(msecs_to_jiffies(100));
2105 schedule_timeout(HZ / 10);
2106 snd_ac97_write(chip->ac97, AC97_PCM, 0); 2103 snd_ac97_write(chip->ac97, AC97_PCM, 0);
2107 2104
2108 memset(&id, 0, sizeof(id)); 2105 memset(&id, 0, sizeof(id));