]> err.no Git - linux-2.6/commitdiff
[ALSA] Single variables for cs5535audio
authorJaya Kumar <jayakumar.alsa@gmail.com>
Fri, 19 May 2006 10:04:22 +0000 (12:04 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 22 Jun 2006 19:33:52 +0000 (21:33 +0200)
As per Takashi's feedback, this is a cleanup to make cs5535audio be
single device per system. The diff is against 2.6.17-rc4 with
Takashi's patch adding the module_params for index, id and enable.

Signed-off-by: Jaya Kumar <jayakumar.alsa@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/cs5535audio/cs5535audio.c

index f61c4fa4ed623d2c1d1a4e53172d04a0d8c8c80c..8f46190f24addb37424ed5b95102bc1b95959586 100644 (file)
@@ -56,16 +56,17 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
        {}
 };
 
-static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
-static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
-static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
+static int index = SNDRV_DEFAULT_IDX1;
+static char *id = SNDRV_DEFAULT_STR1;
+/* for backward compatibility */
+static int enable; 
 
-module_param_array(index, int, NULL, 0444);
+module_param(index, int, 0444);
 MODULE_PARM_DESC(index, "Index value for " DRIVER_NAME);
-module_param_array(id, charp, NULL, 0444);
+module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for " DRIVER_NAME);
-module_param_array(enable, bool, NULL, 0444);
-MODULE_PARM_DESC(enable, "Enable " DRIVER_NAME);
+module_param(enable, bool, 0444);
+MODULE_PARM_DESC(enable, "Enable for " DRIVER_NAME);
 
 static struct pci_device_id snd_cs5535audio_ids[] __devinitdata = {
        { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_AUDIO) },
@@ -357,12 +358,8 @@ static int __devinit snd_cs5535audio_probe(struct pci_dev *pci,
 
        if (dev >= SNDRV_CARDS)
                return -ENODEV;
-       if (!enable[dev]) {
-               dev++;
-               return -ENOENT;
-       }
 
-       card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
+       card = snd_card_new(index, id, THIS_MODULE, 0);
        if (card == NULL)
                return -ENOMEM;