Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / sound / oss / ad1816.c
index 258bb4e..2905783 100644 (file)
@@ -41,7 +41,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
@@ -592,7 +591,7 @@ typedef struct mixer_def mixer_ent;
   {{reg_l, pola_l, pos_l, len_l}, {reg_r, pola_r, pos_r, len_r}}
 
 
-mixer_ent mix_devices[SOUND_MIXER_NRDEVICES][2] = {
+static mixer_ent mix_devices[SOUND_MIXER_NRDEVICES][2] = {
 MIX_ENT(SOUND_MIXER_VOLUME,    14, 1, 8, 5,    14, 1, 0, 5),
 MIX_ENT(SOUND_MIXER_BASS,       0, 0, 0, 0,     0, 0, 0, 0),
 MIX_ENT(SOUND_MIXER_TREBLE,     0, 0, 0, 0,     0, 0, 0, 0),
@@ -874,10 +873,11 @@ ad1816_mixer_reset (ad1816_info * devc)
 }
 
 static int
-ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
+ad1816_mixer_ioctl (int dev, unsigned int cmd, void __user * arg)
 {
        ad1816_info    *devc = mixer_devs[dev]->devc;
        int val;
+       int __user *p = arg;
   
        DEBUGNOISE(printk(KERN_DEBUG "ad1816: mixer_ioctl called!\n"));
   
@@ -889,19 +889,19 @@ ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
                        switch (cmd & 0xff){
                        case SOUND_MIXER_RECSRC:
                                
-                               if (get_user(val, (int *)arg))
+                               if (get_user(val, p))
                                        return -EFAULT;
                                val=ad1816_set_recmask (devc, val);
-                               return put_user(val, (int *)arg);
+                               return put_user(val, p);
                                break;
                                
                        default:
-                               if (get_user(val, (int *)arg))
+                               if (get_user(val, p))
                                        return -EFAULT;
                                if ((val=ad1816_mixer_set (devc, cmd & 0xff, val))<0)
                                        return val;
                                else
-                                       return put_user(val, (int *)arg);
+                                       return put_user(val, p);
                        }
                } else { 
                        /* read ioctl */
@@ -909,34 +909,34 @@ ad1816_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
                                
                        case SOUND_MIXER_RECSRC:
                                val=devc->recmask;
-                               return put_user(val, (int *)arg);
+                               return put_user(val, p);
                                break;
                                
                        case SOUND_MIXER_DEVMASK:
                                val=devc->supported_devices;
-                               return put_user(val, (int *)arg);
+                               return put_user(val, p);
                                break;
 
                        case SOUND_MIXER_STEREODEVS:
                                val=devc->supported_devices & ~(SOUND_MASK_SPEAKER | SOUND_MASK_IMIX);
-                               return put_user(val, (int *)arg);
+                               return put_user(val, p);
                                break;
                                
                        case SOUND_MIXER_RECMASK:
                                val=devc->supported_rec_devices;
-                               return put_user(val, (int *)arg);
+                               return put_user(val, p);
                                break;
                                
                        case SOUND_MIXER_CAPS:
                                val=SOUND_CAP_EXCL_INPUT;
-                               return put_user(val, (int *)arg);
+                               return put_user(val, p);
                                break;
                                
                        default:
                                if ((val=ad1816_mixer_get (devc, cmd & 0xff))<0)
                                        return val;
                                else
-                                       return put_user(val, (int *)arg);
+                                       return put_user(val, p);
                        }
                }
        } else
@@ -1214,16 +1214,16 @@ static int __initdata dma2 = -1;
 /* use isapnp for configuration */
 static int isapnp      = 1;
 static int isapnpjump;
-MODULE_PARM(isapnp, "i");
-MODULE_PARM(isapnpjump, "i");
+module_param(isapnp, bool, 0);
+module_param(isapnpjump, int, 0);
 #endif
 
-MODULE_PARM(io,"i");
-MODULE_PARM(irq,"i");
-MODULE_PARM(dma,"i");
-MODULE_PARM(dma2,"i");
-MODULE_PARM(ad1816_clockfreq,"i");
-MODULE_PARM(options,"i");
+module_param(io, int, 0);
+module_param(irq, int, 0);
+module_param(dma, int, 0);
+module_param(dma2, int, 0);
+module_param(ad1816_clockfreq, int, 0);
+module_param(options, int, 0);
 
 #ifdef __ISAPNP__
 static struct {
@@ -1234,18 +1234,19 @@ static struct {
 } isapnp_ad1816_list[] __initdata = {
        {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
                ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7150), 
-               0 },
+               NULL },
        {       ISAPNP_ANY_ID, ISAPNP_ANY_ID,
                ISAPNP_VENDOR('A','D','S'), ISAPNP_FUNCTION(0x7180),
-               0 },
+               NULL },
        {0}
 };
 
 MODULE_DEVICE_TABLE(isapnp, isapnp_ad1816_list);
 
 
-void __init ad1816_config_pnp_card(struct pnp_card *card, unsigned short vendor,
-       unsigned short function)
+static void __init ad1816_config_pnp_card(struct pnp_card *card,
+                                         unsigned short vendor,
+                                         unsigned short function)
 {
        struct address_info cfg;
        struct pnp_dev *card_dev = pnp_find_dev(card, vendor, function, NULL);
@@ -1269,7 +1270,7 @@ void __init ad1816_config_pnp_card(struct pnp_card *card, unsigned short vendor,
        }
 }
 
-void __init ad1816_config_pnp_cards(void)
+static void __init ad1816_config_pnp_cards(void)
 {
        int nr_pnp_cfg;
        int i;