vserver 1.9.5.x5
[linux-2.6.git] / sound / oss / trident.c
index ed04f40..8395501 100644 (file)
 #include <linux/gameport.h>
 #include <linux/kernel.h>
 #include <asm/uaccess.h>
-#include <asm/hardirq.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 
@@ -1282,7 +1281,7 @@ alloc_dmabuf(struct dmabuf *dmabuf, struct pci_dev *pci_dev, int order)
        dmabuf->buforder = order;
 
        /* now mark the pages as reserved; otherwise */ 
-       /* remap_page_range doesn't do what we want */
+       /* remap_pfn_range doesn't do what we want */
        pend = virt_to_page(rawbuf + (PAGE_SIZE << order) - 1);
        for (page = virt_to_page(rawbuf); page <= pend; page++)
                SetPageReserved(page);
@@ -1874,8 +1873,6 @@ trident_read(struct file *file, char __user *buffer, size_t count, loff_t * ppos
        pr_debug("trident: trident_read called, count = %d\n", count);
 
        VALIDATE_STATE(state);
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
 
        if (dmabuf->mapped)
                return -ENXIO;
@@ -1992,8 +1989,6 @@ trident_write(struct file *file, const char __user *buffer, size_t count, loff_t
        pr_debug("trident: trident_write called, count = %d\n", count);
 
        VALIDATE_STATE(state);
-       if (ppos != &file->f_pos)
-               return -ESPIPE;
 
        /*
         *      Guard against an mmap or ioctl while writing
@@ -2228,7 +2223,8 @@ trident_mmap(struct file *file, struct vm_area_struct *vma)
        if (size > (PAGE_SIZE << dmabuf->buforder))
                goto out;
        ret = -EAGAIN;
-       if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf), 
+       if (remap_pfn_range(vma, vma->vm_start,
+                            virt_to_phys(dmabuf->rawbuf) >> PAGE_SHIFT,
                             size, vma->vm_page_prot))
                goto out;
        dmabuf->mapped = 1;
@@ -2823,7 +2819,7 @@ trident_open(struct inode *inode, struct file *file)
        pr_debug("trident: open virtual channel %d, hard channel %d\n",
                 state->virt, dmabuf->channel->num);
 
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 static int
@@ -4018,7 +4014,8 @@ ali_free_other_states_resources(struct trident_state *state)
        }
 }
 
-struct proc_dir_entry *res;
+static struct proc_dir_entry *res;
+
 static int
 ali_write_proc(struct file *file, const char __user *buffer, unsigned long count, void *data)
 {
@@ -4079,7 +4076,7 @@ trident_open_mixdev(struct inode *inode, struct file *file)
       match:
        file->private_data = card->ac97_codec[i];
 
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 static int
@@ -4599,11 +4596,7 @@ trident_init_module(void)
               "5050 PCI Audio, version " DRIVER_VERSION ", " __TIME__ " " 
               __DATE__ "\n");
 
-       if (!pci_register_driver(&trident_pci_driver)) {
-               pci_unregister_driver(&trident_pci_driver);
-               return -ENODEV;
-       }
-       return 0;
+       return pci_register_driver(&trident_pci_driver);
 }
 
 static void __exit