Commit 35b053be authored by Takashi Iwai's avatar Takashi Iwai

ALSA: ctxfi - Avoid unneeded pci_read_config_*() calls

Use struct pci subsystem_device and revision fields instead of
unneeded calls of pci_read_config_*().
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 9fc20f03
...@@ -1190,14 +1190,14 @@ static int atc_dev_free(struct snd_device *dev) ...@@ -1190,14 +1190,14 @@ static int atc_dev_free(struct snd_device *dev)
static int atc_identify_card(struct ct_atc *atc) static int atc_identify_card(struct ct_atc *atc)
{ {
u16 subsys = 0; u16 subsys;
u8 revision = 0; u8 revision;
struct pci_dev *pci = atc->pci; struct pci_dev *pci = atc->pci;
const struct ct_atc_chip_details *d; const struct ct_atc_chip_details *d;
enum CTCARDS i; enum CTCARDS i;
pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &subsys); subsys = pci->subsystem_device;
pci_read_config_byte(pci, PCI_REVISION_ID, &revision); revision = pci->revision;
atc->chip_details = NULL; atc->chip_details = NULL;
atc->model = NUM_CTCARDS; atc->model = NUM_CTCARDS;
for (d = atc_chip_details; d->vendor; d++) { for (d = atc_chip_details; d->vendor; d++) {
...@@ -1308,7 +1308,7 @@ static int atc_get_resources(struct ct_atc *atc) ...@@ -1308,7 +1308,7 @@ static int atc_get_resources(struct ct_atc *atc)
struct sum_desc sum_dsc = {0}; struct sum_desc sum_dsc = {0};
struct sum_mgr *sum_mgr = NULL; struct sum_mgr *sum_mgr = NULL;
int err = 0, i = 0; int err = 0, i = 0;
unsigned short subsys_id = 0; unsigned short subsys_id;
atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL); atc->daios = kzalloc(sizeof(void *)*(DAIONUM), GFP_KERNEL);
if (NULL == atc->daios) if (NULL == atc->daios)
...@@ -1339,7 +1339,7 @@ static int atc_get_resources(struct ct_atc *atc) ...@@ -1339,7 +1339,7 @@ static int atc_get_resources(struct ct_atc *atc)
} }
atc->n_daio++; atc->n_daio++;
} }
pci_read_config_word(atc->pci, PCI_SUBSYSTEM_ID, &subsys_id); subsys_id = atc->pci->subsystem_device;
if ((subsys_id == 0x0029) || (subsys_id == 0x0031)) { if ((subsys_id == 0x0029) || (subsys_id == 0x0031)) {
/* SB073x cards */ /* SB073x cards */
da_desc.type = SPDIFI1; da_desc.type = SPDIFI1;
......
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