vserver 1.9.5.x5
[linux-2.6.git] / sound / oss / maestro3.c
index 2830f7f..17d4f07 100644 (file)
@@ -378,7 +378,7 @@ static int m3_notifier(struct notifier_block *nb, unsigned long event, void *buf
 static int m3_suspend(struct pci_dev *pci_dev, u32 state);
 static void check_suspend(struct m3_card *card);
 
-struct notifier_block m3_reboot_nb = {
+static struct notifier_block m3_reboot_nb = {
        .notifier_call = m3_notifier,
 };
 
@@ -1024,8 +1024,8 @@ static void set_dmac(struct m3_state *s, unsigned int addr, unsigned int count)
     DPRINTK(DPINT,"set_dmac??\n");
 }
 
-u32 get_dma_pos(struct m3_card *card,
-        int instance_addr)
+static u32 get_dma_pos(struct m3_card *card,
+                      int instance_addr)
 {
     u16 hi = 0, lo = 0;
     int retry = 10;
@@ -1047,7 +1047,7 @@ u32 get_dma_pos(struct m3_card *card,
     return lo | (hi<<16);
 }
 
-u32 get_dmaa(struct m3_state *s)
+static u32 get_dmaa(struct m3_state *s)
 {
     u32 offset;
 
@@ -1059,7 +1059,7 @@ u32 get_dmaa(struct m3_state *s)
     return offset;
 }
 
-u32 get_dmac(struct m3_state *s)
+static u32 get_dmac(struct m3_state *s)
 {
     u32 offset;
 
@@ -1333,8 +1333,6 @@ static ssize_t m3_read(struct file *file, char __user *buffer, size_t count, lof
     int cnt;
     
     VALIDATE_STATE(s);
-    if (ppos != &file->f_pos)
-        return -ESPIPE;
     if (s->dma_adc.mapped)
         return -ENXIO;
     if (!s->dma_adc.ready && (ret = prog_dmabuf(s, 1)))
@@ -1414,8 +1412,6 @@ static ssize_t m3_write(struct file *file, const char __user *buffer, size_t cou
     int cnt;
     
     VALIDATE_STATE(s);
-    if (ppos != &file->f_pos)
-        return -ESPIPE;
     if (s->dma_dac.mapped)
         return -ENXIO;
     if (!s->dma_dac.ready && (ret = prog_dmabuf(s, 0)))
@@ -1561,7 +1557,9 @@ static int m3_mmap(struct file *file, struct vm_area_struct *vma)
      * ask Jeff what the hell I'm doing wrong.
      */
     ret = -EAGAIN;
-    if (remap_page_range(vma, vma->vm_start, virt_to_phys(db->rawbuf), size, vma->vm_page_prot))
+    if (remap_pfn_range(vma, vma->vm_start,
+                       virt_to_phys(db->rawbuf) >> PAGE_SHIFT,
+                       size, vma->vm_page_prot))
         goto out;
 
     db->mapped = 1;
@@ -2051,7 +2049,7 @@ static int m3_open(struct inode *inode, struct file *file)
 
     up(&s->open_sem);
     spin_unlock_irqrestore(&c->lock, flags);
-    return 0;
+    return nonseekable_open(inode, file);
 }
 
 static int m3_release(struct inode *inode, struct file *file)
@@ -2104,7 +2102,7 @@ static int m3_ac97_wait(struct m3_card *card)
     return i == 0;
 }
 
-u16 m3_ac97_read(struct ac97_codec *codec, u8 reg)
+static u16 m3_ac97_read(struct ac97_codec *codec, u8 reg)
 {
     u16 ret = 0;
     struct m3_card *card = codec->private_data;
@@ -2131,7 +2129,7 @@ out:
     return ret;
 }
 
-void m3_ac97_write(struct ac97_codec *codec, u8 reg, u16 val)
+static void m3_ac97_write(struct ac97_codec *codec, u8 reg, u16 val)
 {
     struct m3_card *card = codec->private_data;
 
@@ -2165,7 +2163,7 @@ static int m3_open_mixdev(struct inode *inode, struct file *file)
 
     file->private_data = card->ac97;
 
-    return 0;
+    return nonseekable_open(inode, file);
 }
 
 static int m3_release_mixdev(struct inode *inode, struct file *file)
@@ -2189,7 +2187,7 @@ static struct file_operations m3_mixer_fops = {
        .release = m3_release_mixdev,
 };
 
-void remote_codec_config(int io, int isremote)
+static void remote_codec_config(int io, int isremote)
 {
     isremote = isremote ? 1 : 0;
 
@@ -2573,7 +2571,7 @@ static struct file_operations m3_audio_fops = {
 };
 
 #ifdef CONFIG_PM
-int alloc_dsp_suspendmem(struct m3_card *card)
+static int alloc_dsp_suspendmem(struct m3_card *card)
 {
     int len = sizeof(u16) * (REV_B_CODE_MEMORY_LENGTH + REV_B_DATA_MEMORY_LENGTH);
 
@@ -2582,7 +2580,7 @@ int alloc_dsp_suspendmem(struct m3_card *card)
 
     return 0;
 }
-void free_dsp_suspendmem(struct m3_card *card)
+static void free_dsp_suspendmem(struct m3_card *card)
 {
    if(card->suspend_mem)
        vfree(card->suspend_mem);
@@ -2921,10 +2919,10 @@ MODULE_DESCRIPTION("ESS Maestro3/Allegro Driver");
 MODULE_LICENSE("GPL");
 
 #ifdef M_DEBUG
-MODULE_PARM(debug,"i");
+module_param(debug, int, 0);
 #endif
-MODULE_PARM(external_amp,"i");
-MODULE_PARM(gpio_pin, "i");
+module_param(external_amp, int, 0);
+module_param(gpio_pin, int, 0);
 
 static struct pci_driver m3_pci_driver = {
        .name     = "ess_m3_audio",
@@ -2944,8 +2942,7 @@ static int __init m3_init_module(void)
         return -ENODEV; /* ? */
     }
 
-    if (!pci_register_driver(&m3_pci_driver)) {
-        pci_unregister_driver(&m3_pci_driver);
+    if (pci_register_driver(&m3_pci_driver)) {
         unregister_reboot_notifier(&m3_reboot_nb);
         return -ENODEV;
     }