checkpatch: add check for too short Kconfig descriptions
[safe/jmp/linux-2.6] / sound / oss / au1550_ac97.c
index 4cdb862..c1070e3 100644 (file)
@@ -47,7 +47,6 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/poll.h>
-#include <linux/pci.h>
 #include <linux/bitops.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
@@ -94,7 +93,7 @@ static struct au1550_state {
        spinlock_t      lock;
        struct mutex open_mutex;
        struct mutex sem;
-       mode_t          open_mode;
+       fmode_t          open_mode;
        wait_queue_head_t open_wait;
 
        struct dmabuf {
@@ -615,7 +614,8 @@ start_adc(struct au1550_state *s)
        /* Put two buffers on the ring to get things started.
        */
        for (i=0; i<2; i++) {
-               au1xxx_dbdma_put_dest(db->dmanr, db->nextIn, db->dma_fragsize);
+               au1xxx_dbdma_put_dest(db->dmanr, virt_to_phys(db->nextIn),
+                               db->dma_fragsize, DDMA_FLAGS_IE);
 
                db->nextIn += db->dma_fragsize;
                if (db->nextIn >= db->rawbuf + db->dmasize)
@@ -719,8 +719,7 @@ prog_dmabuf_dac(struct au1550_state *s)
 }
 
 
-static void
-dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static void dac_dma_interrupt(int irq, void *dev_id)
 {
        struct au1550_state *s = (struct au1550_state *) dev_id;
        struct dmabuf  *db = &s->dma_dac;
@@ -734,8 +733,9 @@ dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        db->dma_qcount--;
 
        if (db->count >= db->fragsize) {
-               if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
-                                                       db->fragsize) == 0) {
+               if (au1xxx_dbdma_put_source(db->dmanr,
+                               virt_to_phys(db->nextOut), db->fragsize,
+                               DDMA_FLAGS_IE) == 0) {
                        err("qcount < 2 and no ring room!");
                }
                db->nextOut += db->fragsize;
@@ -754,8 +754,7 @@ dac_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 
-static void
-adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static void adc_dma_interrupt(int irq, void *dev_id)
 {
        struct  au1550_state *s = (struct au1550_state *)dev_id;
        struct  dmabuf  *dp = &s->dma_adc;
@@ -780,7 +779,8 @@ adc_dma_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 
        /* Put a new empty buffer on the destination DMA.
        */
-       au1xxx_dbdma_put_dest(dp->dmanr, dp->nextIn, dp->dma_fragsize);
+       au1xxx_dbdma_put_dest(dp->dmanr, virt_to_phys(dp->nextIn),
+                             dp->dma_fragsize, DDMA_FLAGS_IE);
 
        dp->nextIn += dp->dma_fragsize;
        if (dp->nextIn >= dp->rawbuf + dp->dmasize)
@@ -1180,8 +1180,9 @@ au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
                 * we know the dma has stopped.
                 */
                while ((db->dma_qcount < 2) && (db->count >= db->fragsize)) {
-                       if (au1xxx_dbdma_put_source(db->dmanr, db->nextOut,
-                                                       db->fragsize) == 0) {
+                       if (au1xxx_dbdma_put_source(db->dmanr,
+                               virt_to_phys(db->nextOut), db->fragsize,
+                               DDMA_FLAGS_IE) == 0) {
                                err("qcount < 2 and no ring room!");
                        }
                        db->nextOut += db->fragsize;
@@ -1356,11 +1357,11 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                ((file->f_mode & FMODE_READ) && s->dma_adc.mapped);
 
 #ifdef DEBUG
-       for (count=0; count<sizeof(ioctl_str)/sizeof(ioctl_str[0]); count++) {
+       for (count = 0; count < ARRAY_SIZE(ioctl_str); count++) {
                if (ioctl_str[count].cmd == cmd)
                        break;
        }
-       if (count < sizeof(ioctl_str) / sizeof(ioctl_str[0]))
+       if (count < ARRAY_SIZE(ioctl_str))
                pr_debug("ioctl %s, arg=0x%lxn", ioctl_str[count].str, arg);
        else
                pr_debug("ioctl 0x%x unknown, arg=0x%lx\n", cmd, arg);
@@ -1630,7 +1631,9 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                                    sizeof(abinfo)) ? -EFAULT : 0;
 
        case SNDCTL_DSP_NONBLOCK:
+               spin_lock(&file->f_lock);
                file->f_flags |= O_NONBLOCK;
+               spin_unlock(&file->f_lock);
                return 0;
 
        case SNDCTL_DSP_GETODELAY: