Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23d4635ed336c7dadb3590ee7d275ac612f06ebf
Commit:     23d4635ed336c7dadb3590ee7d275ac612f06ebf
Parent:     503fc85a3b15b0e939ad9672e376ffc9c4840591
Author:     Krzysztof Helt <krzysztof.h1 at wp.pl>
AuthorDate: Tue Sep 11 00:40:42 2007 +0200
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 16:49:29 2007 +0200

    [ALSA] cs4231-lib: improved waiting after mce_down
    
    This patch replaces long msleeps in waiting loops
    with schedule_timeout() calls.
    
    Signed-off-by: Krzysztof Helt <krzysztof.h1 at wp.pl>
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 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 c0ffb20..e73554f 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)
 
        snd_printdd("(1) jiffies = %lu\n", jiffies);
 
-       /* in 10 ms increments, check condition, up to 250 ms */
-       timeout = 25;
-       while (snd_cs4231_in(chip, CS4231_TEST_INIT) & 
CS4231_CALIB_IN_PROGRESS) {
-               if (--timeout < 0) {
-                       snd_printk("mce_down - auto calibration time out 
(2)\n");
+       /* check condition up to 250 ms */
+       timeout = msecs_to_jiffies(250);
+       while (snd_cs4231_in(chip, CS4231_TEST_INIT) &
+               CS4231_CALIB_IN_PROGRESS) {
+
+               if (timeout <= 0) {
+                       snd_printk(KERN_ERR "mce_down - "
+                                       "auto calibration time out (2)\n");
                        return;
                }
-               msleep(10);
+               timeout = schedule_timeout(timeout);
        }
 
        snd_printdd("(2) jiffies = %lu\n", jiffies);
 
-       /* in 10 ms increments, check condition, up to 100 ms */
-       timeout = 10;
+       /* check condition up to 100 ms */
+       timeout = msecs_to_jiffies(100);
        while (cs4231_inb(chip, CS4231P(REGSEL)) & CS4231_INIT) {
-               if (--timeout < 0) {
+               if (timeout <= 0) {
                        snd_printk(KERN_ERR "mce_down - auto calibration time 
out (3)\n");
                        return;
                }
-               msleep(10);
+               timeout = schedule_timeout(timeout);
        }
 
        snd_printdd("(3) jiffies = %lu\n", jiffies);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to