linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / media / radio / radio-typhoon.c
index edd0122..8ac9a8e 100644 (file)
@@ -36,7 +36,6 @@
 #include <asm/io.h>            /* outb, outb_p                   */
 #include <asm/uaccess.h>       /* copy to/from user              */
 #include <linux/videodev.h>    /* kernel radio structs           */
-#include <media/v4l2-common.h>
 #include <linux/config.h>      /* CONFIG_RADIO_TYPHOON_*         */
 
 #define BANNER "Typhoon Radio Card driver v0.1\n"
@@ -60,7 +59,7 @@ struct typhoon_device {
        int muted;
        unsigned long curfreq;
        unsigned long mutefreq;
-       struct mutex lock;
+       struct semaphore lock;
 };
 
 static void typhoon_setvol_generic(struct typhoon_device *dev, int vol);
@@ -78,12 +77,12 @@ static int typhoon_get_info(char *buf, char **start, off_t offset, int len);
 
 static void typhoon_setvol_generic(struct typhoon_device *dev, int vol)
 {
-       mutex_lock(&dev->lock);
+       down(&dev->lock);
        vol >>= 14;                             /* Map 16 bit to 2 bit */
        vol &= 3;
        outb_p(vol / 2, dev->iobase);           /* Set the volume, high bit. */
        outb_p(vol % 2, dev->iobase + 2);       /* Set the volume, low bit. */
-       mutex_unlock(&dev->lock);
+       up(&dev->lock);
 }
 
 static int typhoon_setfreq_generic(struct typhoon_device *dev,
@@ -103,7 +102,7 @@ static int typhoon_setfreq_generic(struct typhoon_device *dev,
         *
         */
 
-       mutex_lock(&dev->lock);
+       down(&dev->lock);
        x = frequency / 160;
        outval = (x * x + 2500) / 5000;
        outval = (outval * x + 5000) / 10000;
@@ -113,7 +112,7 @@ static int typhoon_setfreq_generic(struct typhoon_device *dev,
        outb_p((outval >> 8) & 0x01, dev->iobase + 4);
        outb_p(outval >> 9, dev->iobase + 6);
        outb_p(outval & 0xff, dev->iobase + 8);
-       mutex_unlock(&dev->lock);
+       up(&dev->lock);
 
        return 0;
 }
@@ -338,7 +337,7 @@ static int __init typhoon_init(void)
 #endif /* MODULE */
 
        printk(KERN_INFO BANNER);
-       mutex_init(&typhoon_unit.lock);
+       init_MUTEX(&typhoon_unit.lock);
        io = typhoon_unit.iobase;
        if (!request_region(io, 8, "typhoon")) {
                printk(KERN_ERR "radio-typhoon: port 0x%x already in use\n",
@@ -362,8 +361,8 @@ static int __init typhoon_init(void)
 
 #ifdef CONFIG_RADIO_TYPHOON_PROC_FS
        if (!create_proc_info_entry("driver/radio-typhoon", 0, NULL,
-                                   typhoon_get_info))
-               printk(KERN_ERR "radio-typhoon: registering /proc/driver/radio-typhoon failed\n");
+                                   typhoon_get_info)) 
+               printk(KERN_ERR "radio-typhoon: registering /proc/driver/radio-typhoon failed\n");
 #endif
 
        return 0;