Commit f41bea84 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] atiixp - Use quirk list helper function

Clean up ac97_codec quirk using snd_pci_quirk_lookup().
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent d9ea472c
...@@ -296,21 +296,9 @@ static struct pci_device_id snd_atiixp_ids[] = { ...@@ -296,21 +296,9 @@ static struct pci_device_id snd_atiixp_ids[] = {
MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); MODULE_DEVICE_TABLE(pci, snd_atiixp_ids);
struct atiixp_quirk { static struct snd_pci_quirk atiixp_quirks[] __devinitdata = {
unsigned short subvendor; SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0),
unsigned short subdevice; { } /* terminator */
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 */
}; };
/* /*
...@@ -574,17 +562,13 @@ static int snd_atiixp_aclink_down(struct atiixp *chip) ...@@ -574,17 +562,13 @@ static int snd_atiixp_aclink_down(struct atiixp *chip)
static int ac97_probing_bugs(struct pci_dev *pci) static int ac97_probing_bugs(struct pci_dev *pci)
{ {
int i = 0; const struct snd_pci_quirk *q;
while (atiixp_quirks[i].subvendor) { q = snd_pci_quirk_lookup(pci, atiixp_quirks);
if (pci->subsystem_vendor == atiixp_quirks[i].subvendor && if (q) {
pci->subsystem_device == atiixp_quirks[i].subdevice) { snd_printdd(KERN_INFO "Atiixp quirk for %s. "
printk(KERN_INFO "Atiixp quirk for %s. " "Forcing codec %d\n", q->name, q->value);
"Forcing codec %d\n", atiixp_quirks[i].name, return q->value;
atiixp_quirks[i].ac97_codec);
return atiixp_quirks[i].ac97_codec;
}
i++;
} }
/* this hardware doesn't need workarounds. Probe for codec */ /* this hardware doesn't need workarounds. Probe for codec */
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment