[PATCH] OSS: Use ARRAY_SIZE macro when appropriate (2)
[sfrench/cifs-2.6.git] / sound / oss / au1550_ac97.c
index 6a4956b8025df671e4ce94ebbec9ad533f8bc834..a339f0c0d5129323068a89831adb19fcbefa38cc 100644 (file)
@@ -57,9 +57,9 @@
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/hardirq.h>
-#include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_psc.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
+#include <asm/mach-au1x00/au1xxx.h>
 
 #undef OSS_DOCUMENTED_MIXER_SEMANTICS
 
@@ -79,7 +79,7 @@
  * 0 = no VRA, 1 = use VRA if codec supports it
  */
 static int      vra = 1;
-MODULE_PARM(vra, "i");
+module_param(vra, bool, 0);
 MODULE_PARM_DESC(vra, "if 1 use VRA if codec supports it");
 
 static struct au1550_state {
@@ -213,7 +213,8 @@ rdcodec(struct ac97_codec *codec, u8 addr)
        }
        if (i == POLL_COUNT) {
                err("rdcodec: read poll expired!");
-               return 0;
+               data = 0;
+               goto out;
        }
 
        /* wait for command done?
@@ -226,7 +227,8 @@ rdcodec(struct ac97_codec *codec, u8 addr)
        }
        if (i == POLL_COUNT) {
                err("rdcodec: read cmdwait expired!");
-               return 0;
+               data = 0;
+               goto out;
        }
 
        data = au_readl(PSC_AC97CDC) & 0xffff;
@@ -237,6 +239,7 @@ rdcodec(struct ac97_codec *codec, u8 addr)
        au_writel(PSC_AC97EVNT_CD, PSC_AC97EVNT);
        au_sync();
 
+ out:
        spin_unlock_irqrestore(&s->lock, flags);
 
        return data;
@@ -716,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;
@@ -751,8 +753,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;
@@ -1353,11 +1354,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);
@@ -1892,6 +1893,8 @@ static /*const */ struct file_operations au1550_audio_fops = {
 
 MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
 MODULE_DESCRIPTION("Au1550 AC97 Audio Driver");
+MODULE_LICENSE("GPL");
+
 
 static int __devinit
 au1550_probe(void)