diff options
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/cs423x/cs4231_lib.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c index c0ffb20da996..e73554feccd5 100644 --- a/sound/isa/cs423x/cs4231_lib.c +++ b/sound/isa/cs423x/cs4231_lib.c | |||
@@ -343,26 +343,29 @@ void snd_cs4231_mce_down(struct snd_cs4231 *chip) | |||
343 | 343 | ||
344 | snd_printdd("(1) jiffies = %lu\n", jiffies); | 344 | snd_printdd("(1) jiffies = %lu\n", jiffies); |
345 | 345 | ||
346 | /* in 10 ms increments, check condition, up to 250 ms */ | 346 | /* check condition up to 250 ms */ |
347 | timeout = 25; | 347 | timeout = msecs_to_jiffies(250); |
348 | while (snd_cs4231_in(chip, CS4231_TEST_INIT) & CS4231_CALIB_IN_PROGRESS) { | 348 | while (snd_cs4231_in(chip, CS4231_TEST_INIT) & |
349 | if (--timeout < 0) { | 349 | CS4231_CALIB_IN_PROGRESS) { |
350 | snd_printk("mce_down - auto calibration time out (2)\n"); | 350 | |
351 | if (timeout <= 0) { | ||
352 | snd_printk(KERN_ERR "mce_down - " | ||
353 | "auto calibration time out (2)\n"); | ||
351 | return; | 354 | return; |
352 | } | 355 | } |
353 | msleep(10); | 356 | timeout = schedule_timeout(timeout); |
354 | } | 357 | } |
355 | 358 | ||
356 | snd_printdd("(2) jiffies = %lu\n", jiffies); | 359 | snd_printdd("(2) jiffies = %lu\n", jiffies); |
357 | 360 | ||
358 | /* in 10 ms increments, check condition, up to 100 ms */ | 361 | /* check condition up to 100 ms */ |
359 | timeout = 10; | 362 | timeout = msecs_to_jiffies(100); |
360 | while (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) { | 363 | while (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) { |
361 | if (--timeout < 0) { | 364 | if (timeout <= 0) { |
362 | snd_printk(KERN_ERR "mce_down - auto calibration time out (3)\n"); | 365 | snd_printk(KERN_ERR "mce_down - auto calibration time out (3)\n"); |
363 | return; | 366 | return; |
364 | } | 367 | } |
365 | msleep(10); | 368 | timeout = schedule_timeout(timeout); |
366 | } | 369 | } |
367 | 370 | ||
368 | snd_printdd("(3) jiffies = %lu\n", jiffies); | 371 | snd_printdd("(3) jiffies = %lu\n", jiffies); |