aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-11-24 09:35:18 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:01:48 -0500
commitf41bea84c030793b502aa2526bb22476788e731e (patch)
treebce9663227044dd9350a5890e389411ac58cfe30
parentd9ea472c743ccd7344055cb118bc210befbd8007 (diff)
[ALSA] atiixp - Use quirk list helper function
Clean up ac97_codec quirk using snd_pci_quirk_lookup(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/atiixp.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 92df811d695d..7d8053b5e8d5 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -296,21 +296,9 @@ static struct pci_device_id snd_atiixp_ids[] = {
296 296
297MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); 297MODULE_DEVICE_TABLE(pci, snd_atiixp_ids);
298 298
299struct atiixp_quirk { 299static struct snd_pci_quirk atiixp_quirks[] __devinitdata = {
300 unsigned short subvendor; 300 SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0),
301 unsigned short subdevice; 301 { } /* terminator */
302 const char *name;
303 int ac97_codec;
304};
305
306static struct atiixp_quirk atiixp_quirks[] __devinitdata = {
307 {
308 .subvendor = 0x15bd,
309 .subdevice = 0x3100,
310 .name = "DFI RS482",
311 .ac97_codec = 0,
312 },
313 { .subvendor = 0 } /* terminator */
314}; 302};
315 303
316/* 304/*
@@ -574,17 +562,13 @@ static int snd_atiixp_aclink_down(struct atiixp *chip)
574 562
575static int ac97_probing_bugs(struct pci_dev *pci) 563static int ac97_probing_bugs(struct pci_dev *pci)
576{ 564{
577 int i = 0; 565 const struct snd_pci_quirk *q;
578 566
579 while (atiixp_quirks[i].subvendor) { 567 q = snd_pci_quirk_lookup(pci, atiixp_quirks);
580 if (pci->subsystem_vendor == atiixp_quirks[i].subvendor && 568 if (q) {
581 pci->subsystem_device == atiixp_quirks[i].subdevice) { 569 snd_printdd(KERN_INFO "Atiixp quirk for %s. "
582 printk(KERN_INFO "Atiixp quirk for %s. " 570 "Forcing codec %d\n", q->name, q->value);
583 "Forcing codec %d\n", atiixp_quirks[i].name, 571 return q->value;
584 atiixp_quirks[i].ac97_codec);
585 return atiixp_quirks[i].ac97_codec;
586 }
587 i++;
588 } 572 }
589 /* this hardware doesn't need workarounds. Probe for codec */ 573 /* this hardware doesn't need workarounds. Probe for codec */
590 return -1; 574 return -1;