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/fm801.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/fm801.c')
-rw-r--r-- | sound/pci/fm801.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 47dbe317069f..4c7c8d225c7f 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1303,8 +1303,7 @@ static int __devinit snd_fm801_create(snd_card_t * card, | |||
1303 | do { | 1303 | do { |
1304 | if ((inw(FM801_REG(chip, AC97_CMD)) & (3<<8)) == (1<<8)) | 1304 | if ((inw(FM801_REG(chip, AC97_CMD)) & (3<<8)) == (1<<8)) |
1305 | goto __ac97_secondary; | 1305 | goto __ac97_secondary; |
1306 | set_current_state(TASK_UNINTERRUPTIBLE); | 1306 | schedule_timeout_uninterruptible(1); |
1307 | schedule_timeout(1); | ||
1308 | } while (time_after(timeout, jiffies)); | 1307 | } while (time_after(timeout, jiffies)); |
1309 | snd_printk(KERN_ERR "Primary AC'97 codec not found\n"); | 1308 | snd_printk(KERN_ERR "Primary AC'97 codec not found\n"); |
1310 | snd_fm801_free(chip); | 1309 | snd_fm801_free(chip); |
@@ -1329,8 +1328,7 @@ static int __devinit snd_fm801_create(snd_card_t * card, | |||
1329 | goto __ac97_ok; | 1328 | goto __ac97_ok; |
1330 | } | 1329 | } |
1331 | } | 1330 | } |
1332 | set_current_state(TASK_UNINTERRUPTIBLE); | 1331 | schedule_timeout_uninterruptible(1); |
1333 | schedule_timeout(1); | ||
1334 | } while (time_after(timeout, jiffies)); | 1332 | } while (time_after(timeout, jiffies)); |
1335 | } | 1333 | } |
1336 | 1334 | ||
@@ -1343,8 +1341,7 @@ static int __devinit snd_fm801_create(snd_card_t * card, | |||
1343 | do { | 1341 | do { |
1344 | if ((inw(FM801_REG(chip, AC97_CMD)) & (3<<8)) == (1<<8)) | 1342 | if ((inw(FM801_REG(chip, AC97_CMD)) & (3<<8)) == (1<<8)) |
1345 | goto __ac97_ok; | 1343 | goto __ac97_ok; |
1346 | set_current_state(TASK_UNINTERRUPTIBLE); | 1344 | schedule_timeout_uninterruptible(1); |
1347 | schedule_timeout(1); | ||
1348 | } while (time_after(timeout, jiffies)); | 1345 | } while (time_after(timeout, jiffies)); |
1349 | snd_printk(KERN_ERR "Primary AC'97 codec not responding\n"); | 1346 | snd_printk(KERN_ERR "Primary AC'97 codec not responding\n"); |
1350 | snd_fm801_free(chip); | 1347 | snd_fm801_free(chip); |