linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / media / radio / radio-aimslab.c
index 557fb5c..914deab 100644 (file)
@@ -43,7 +43,7 @@
 
 static int io = CONFIG_RADIO_RTRACK_PORT; 
 static int radio_nr = -1;
-static struct mutex lock;
+static struct semaphore lock;
 
 struct rt_device
 {
@@ -83,23 +83,23 @@ static void rt_incvol(void)
 static void rt_mute(struct rt_device *dev)
 {
        dev->muted = 1;
-       mutex_lock(&lock);
+       down(&lock);
        outb(0xd0, io);                 /* volume steady, off           */
-       mutex_unlock(&lock);
+       up(&lock);
 }
 
 static int rt_setvol(struct rt_device *dev, int vol)
 {
        int i;
 
-       mutex_lock(&lock);
+       down(&lock);
        
        if(vol == dev->curvol) {        /* requested volume = current */
                if (dev->muted) {       /* user is unmuting the card  */
                        dev->muted = 0;
                        outb (0xd8, io);        /* enable card */
                }       
-               mutex_unlock(&lock);
+               up(&lock);
                return 0;
        }
 
@@ -108,7 +108,7 @@ static int rt_setvol(struct rt_device *dev, int vol)
                sleep_delay(2000000);   /* make sure it's totally down  */
                outb(0xd0, io);         /* volume steady, off           */
                dev->curvol = 0;        /* track the volume state!      */
-               mutex_unlock(&lock);
+               up(&lock);
                return 0;
        }
 
@@ -121,7 +121,7 @@ static int rt_setvol(struct rt_device *dev, int vol)
                        rt_decvol();
 
        dev->curvol = vol;
-       mutex_unlock(&lock);
+       up(&lock);
        return 0;
 }
 
@@ -168,7 +168,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
        freq += 171200;                 /* Add 10.7 MHz IF              */
        freq /= 800;                    /* Convert to 50 kHz units      */
        
-       mutex_lock(&lock);                      /* Stop other ops interfering */
+       down(&lock);                    /* Stop other ops interfering */
         
        send_0_byte (io, dev);          /*  0: LSB of frequency         */
 
@@ -196,7 +196,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq)
        else
                outb (0xd8, io);        /* volume steady + sigstr + on */
                
-       mutex_unlock(&lock);
+       up(&lock);
 
        return 0;
 }
@@ -337,7 +337,7 @@ static int __init rtrack_init(void)
 
        /* Set up the I/O locking */
        
-       mutex_init(&lock);
+       init_MUTEX(&lock);
        
        /* mute card - prevents noisy bootups */