This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / sound / oss / forte.c
index c7e23fc..8406bc9 100644 (file)
@@ -45,7 +45,6 @@
 #include <linux/proc_fs.h>
 
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/io.h>
 
 #define DRIVER_NAME    "forte"
@@ -239,7 +238,7 @@ forte_ac97_wait (struct forte_chip *chip)
  * @reg:       register to read
  */
 
-u16
+static u16
 forte_ac97_read (struct ac97_codec *codec, u8 reg)
 {
        u16 ret = 0;
@@ -284,7 +283,7 @@ forte_ac97_read (struct ac97_codec *codec, u8 reg)
  * @val:       value to write
  */
 
-void
+static void
 forte_ac97_write (struct ac97_codec *codec, u8 reg, u16 val)
 {
        struct forte_chip *chip = codec->private_data;
@@ -1265,7 +1264,7 @@ forte_dsp_open (struct inode *inode, struct file *file)
        if (file->f_mode & FMODE_READ)
                forte_channel_init (forte, &forte->rec);
 
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 
@@ -1410,7 +1409,8 @@ forte_dsp_mmap (struct file *file, struct vm_area_struct *vma)
                 goto out;
        }
 
-        if (remap_page_range (vma, vma->vm_start, virt_to_phys (channel->buf),
+        if (remap_pfn_range(vma, vma->vm_start,
+                             virt_to_phys(channel->buf) >> PAGE_SHIFT,
                              size, vma->vm_page_prot)) {
                DPRINTK ("%s: remap el a no worko\n", __FUNCTION__);
                ret = -EAGAIN;
@@ -1438,9 +1438,6 @@ forte_dsp_write (struct file *file, const char __user *buffer, size_t bytes,
        unsigned int i = bytes, sz = 0;
        unsigned long flags;
 
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
-
        if (!access_ok (VERIFY_READ, buffer, bytes))
                return -EFAULT;
 
@@ -1546,9 +1543,6 @@ forte_dsp_read (struct file *file, char __user *buffer, size_t bytes,
        unsigned int i = bytes, sz;
        unsigned long flags;
 
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
-
        if (!access_ok (VERIFY_WRITE, buffer, bytes))
                return -EFAULT;
 
@@ -1847,15 +1841,15 @@ forte_proc_read (char *page, char **start, off_t off, int count,
 static int __init 
 forte_proc_init (void)
 {
-       if (!proc_mkdir ("driver/forte", 0))
+       if (!proc_mkdir ("driver/forte", NULL))
                return -EIO;
 
-       if (!create_proc_read_entry ("driver/forte/chip", 0, 0, forte_proc_read, forte)) {
+       if (!create_proc_read_entry ("driver/forte/chip", 0, NULL, forte_proc_read, forte)) {
                remove_proc_entry ("driver/forte", NULL);
                return -EIO;
        }
 
-       if (!create_proc_read_entry("driver/forte/ac97", 0, 0, ac97_read_proc, forte->ac97)) {
+       if (!create_proc_read_entry("driver/forte/ac97", 0, NULL, ac97_read_proc, forte->ac97)) {
                remove_proc_entry ("driver/forte/chip", NULL);
                remove_proc_entry ("driver/forte", NULL);
                return -EIO;
@@ -2118,12 +2112,7 @@ forte_init_module (void)
 {
        printk (KERN_INFO PFX DRIVER_VERSION "\n");
 
-       if (!pci_register_driver (&forte_pci_driver)) {
-               pci_unregister_driver (&forte_pci_driver);
-               return -ENODEV;
-       }
-
-       return 0;
+       return pci_register_driver (&forte_pci_driver);
 }