Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[powerpc.git] / sound / pci / atiixp.c
index 92df811..89184a4 100644 (file)
@@ -296,21 +296,9 @@ static struct pci_device_id snd_atiixp_ids[] = {
 
 MODULE_DEVICE_TABLE(pci, snd_atiixp_ids);
 
-struct atiixp_quirk {
-       unsigned short  subvendor;
-       unsigned short  subdevice;
-       const char *name;
-       int ac97_codec;
-};
-
-static struct atiixp_quirk atiixp_quirks[] __devinitdata = {
-       {
-               .subvendor = 0x15bd,
-               .subdevice = 0x3100,
-               .name = "DFI RS482",
-               .ac97_codec = 0,
-       },
-       { .subvendor = 0 } /* terminator */
+static struct snd_pci_quirk atiixp_quirks[] __devinitdata = {
+       SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0),
+       { } /* terminator */
 };
 
 /*
@@ -574,17 +562,13 @@ static int snd_atiixp_aclink_down(struct atiixp *chip)
 
 static int ac97_probing_bugs(struct pci_dev *pci)
 {
-       int i = 0;
-
-       while (atiixp_quirks[i].subvendor) {
-               if (pci->subsystem_vendor == atiixp_quirks[i].subvendor  &&
-                   pci->subsystem_device == atiixp_quirks[i].subdevice) {
-                       printk(KERN_INFO "Atiixp quirk for %s.  "
-                              "Forcing codec %d\n", atiixp_quirks[i].name, 
-                              atiixp_quirks[i].ac97_codec);
-                       return atiixp_quirks[i].ac97_codec;
-               }
-               i++;
+       const struct snd_pci_quirk *q;
+
+       q = snd_pci_quirk_lookup(pci, atiixp_quirks);
+       if (q) {
+               snd_printdd(KERN_INFO "Atiixp quirk for %s.  "
+                           "Forcing codec %d\n", q->name, q->value);
+               return q->value;
        }
        /* this hardware doesn't need workarounds.  Probe for codec */
        return -1;
@@ -1655,15 +1639,12 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
 {
        struct snd_card *card;
        struct atiixp *chip;
-       unsigned char revision;
        int err;
 
        card = snd_card_new(index, id, THIS_MODULE, 0);
        if (card == NULL)
                return -ENOMEM;
 
-       pci_read_config_byte(pci, PCI_REVISION_ID, &revision);
-
        strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA");
        strcpy(card->shortname, "ATI IXP");
        if ((err = snd_atiixp_create(card, pci, &chip)) < 0)
@@ -1686,7 +1667,8 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
        snd_atiixp_chip_start(chip);
 
        snprintf(card->longname, sizeof(card->longname),
-                "%s rev %x with %s at %#lx, irq %i", card->shortname, revision,
+                "%s rev %x with %s at %#lx, irq %i", card->shortname,
+                pci->revision,
                 chip->ac97[0] ? snd_ac97_get_short_name(chip->ac97[0]) : "?",
                 chip->addr, chip->irq);