Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f79415207ea60109d34bed89b2f3ed303a18d24b
Commit:     f79415207ea60109d34bed89b2f3ed303a18d24b
Parent:     3a5bdee5fa98bfd7d04c61b37b746eb918472e82
Author:     Krzysztof Helt <[EMAIL PROTECTED]>
AuthorDate: Mon Sep 17 12:52:43 2007 +0200
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 16:50:40 2007 +0200

    [ALSA] ad1848_lib: waiting loops done after cs4231_lib
    
    This patch fixes ad1848_lib waiting loops to be the same as in the 
cs4231_lib.
    Acked-by: Rene Herman <[EMAIL PROTECTED]>
    
    Signed-off-by: Krzysztof Helt <[EMAIL PROTECTED]>
    Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/isa/ad1848/ad1848_lib.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index eee941b..330b5ce 100644
--- a/sound/isa/ad1848/ad1848_lib.c
+++ b/sound/isa/ad1848/ad1848_lib.c
@@ -205,7 +205,7 @@ static void snd_ad1848_mce_down(struct snd_ad1848 *chip)
 {
        unsigned long flags;
        int timeout;
-       signed long time;
+       unsigned long end_time;
 
        spin_lock_irqsave(&chip->reg_lock, flags);
        for (timeout = 5; timeout > 0; timeout--)
@@ -240,27 +240,27 @@ static void snd_ad1848_mce_down(struct snd_ad1848 *chip)
 
        snd_printdd("(2) jiffies = %lu\n", jiffies);
 
-       time = msecs_to_jiffies(250);
+       end_time = jiffies + msecs_to_jiffies(250);
        while (snd_ad1848_in(chip, AD1848_TEST_INIT) & 
AD1848_CALIB_IN_PROGRESS) {
                spin_unlock_irqrestore(&chip->reg_lock, flags);
-               if (time <= 0) {
+               if (time_after(jiffies, end_time)) {
                        snd_printk(KERN_ERR "mce_down - auto calibration time 
out (2)\n");
                        return;
                }
-               time = schedule_timeout(time);
+               msleep(1);
                spin_lock_irqsave(&chip->reg_lock, flags);
        }
 
        snd_printdd("(3) jiffies = %lu\n", jiffies);
 
-       time = msecs_to_jiffies(100);
+       end_time = jiffies + msecs_to_jiffies(100);
        while (inb(AD1848P(chip, REGSEL)) & AD1848_INIT) {
                spin_unlock_irqrestore(&chip->reg_lock, flags);
-               if (time <= 0) {
+               if (time_after(jiffies, end_time)) {
                        snd_printk(KERN_ERR "mce_down - auto calibration time 
out (3)\n");
                        return;
                }
-               time = schedule_timeout(time);
+               msleep(1);
                spin_lock_irqsave(&chip->reg_lock, flags);
        }
        spin_unlock_irqrestore(&chip->reg_lock, flags);
-
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