This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / sound / pci / korg1212 / korg1212.c
index d196d22..c2fc6e3 100644 (file)
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/wait.h>
+#include <linux/moduleparam.h>
 
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
-#define SNDRV_GET_ID
 #include <sound/initval.h>
 
 #include <asm/io.h>
@@ -417,14 +417,15 @@ MODULE_DEVICES("{{KORG,korg1212}}");
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;         /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */
+static int boot_devs;
 
-MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(index, int, boot_devs, 0444);
 MODULE_PARM_DESC(index, "Index value for Korg 1212 soundcard.");
 MODULE_PARM_SYNTAX(index, SNDRV_INDEX_DESC);
-MODULE_PARM(id, "1-" __MODULE_STRING(SNDRV_CARDS) "s");
+module_param_array(id, charp, boot_devs, 0444);
 MODULE_PARM_DESC(id, "ID string for Korg 1212 soundcard.");
 MODULE_PARM_SYNTAX(id, SNDRV_ID_DESC);
-MODULE_PARM(enable, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
+module_param_array(enable, bool, boot_devs, 0444);
 MODULE_PARM_DESC(enable, "Enable Korg 1212 soundcard.");
 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
 MODULE_AUTHOR("Haroldo Gamal <gamal@alternex.com.br>");
@@ -2504,15 +2505,14 @@ snd_korg1212_probe(struct pci_dev *pci,
                snd_card_free(card);
                return err;
        }
-       pci_set_drvdata(pci, korg1212);
+       pci_set_drvdata(pci, card);
        dev++;
        return 0;
 }
 
 static void __devexit snd_korg1212_remove(struct pci_dev *pci)
 {
-       korg1212_t *korg1212 = pci_get_drvdata(pci);
-       snd_card_free(korg1212->card);
+       snd_card_free(pci_get_drvdata(pci));
        pci_set_drvdata(pci, NULL);
 }
 
@@ -2525,15 +2525,7 @@ static struct pci_driver driver = {
 
 static int __init alsa_card_korg1212_init(void)
 {
-       int err;
-
-       if ((err = pci_module_init(&driver)) < 0) {
-#ifdef MODULE
-               printk(KERN_ERR "No Korg 1212IO cards found\n");
-#endif
-               return err;
-       }
-       return 0;
+       return pci_module_init(&driver);
 }
 
 static void __exit alsa_card_korg1212_exit(void)
@@ -2543,25 +2535,3 @@ static void __exit alsa_card_korg1212_exit(void)
 
 module_init(alsa_card_korg1212_init)
 module_exit(alsa_card_korg1212_exit)
-
-#ifndef MODULE
-
-/* format is: snd-korg1212=enable,index,id */
-
-static int __init alsa_card_korg1212_setup(char *str)
-{
-       static unsigned __initdata nr_dev = 0;
-
-       if (nr_dev >= SNDRV_CARDS)
-               return 0;
-       (void)(get_option(&str,&enable[nr_dev]) == 2 &&
-              get_option(&str,&index[nr_dev]) == 2 &&
-              get_id(&str,&id[nr_dev]) == 2);
-       nr_dev++;
-       return 1;
-}
-
-__setup("snd-korg1212=", alsa_card_korg1212_setup);
-
-#endif /* ifndef MODULE */
-