Skip to contentSkip to conversation

ALSA: ac97: copy subsys values from the PCI device

PATCH In review Rene Herman 2 participants 3 messages Jul 17, 2008 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: ac97: copy subsys values from the PCI device

Hi.

Just getting to know to the code...

Why do we reread the subsys values from PCI config space in the AC97 code?

(this in addition to why we store the values in the ac97 struct in the first place if they're available through ac97->pci but that's secondary)

Rene.

Quoted 1 line

From 01de5a42c7d5a0237895a476735028298203f30f Mon Sep 17 00:00:00 2001

From: Rene Herman <[email protected]>
Date: Thu, 17 Jul 2008 14:18:10 +0200
Subject: [PATCH] ALSA: ac97: copy subsys values from the PCI device

copy the subsys values from the PCI device instead of rereading them.

---
 sound/pci/ac97/ac97_codec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/ac97/ac97_codec.c +2 -2
index 45fd290..4f4343d 100644
@@ -2015,8 +2015,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
 
 #ifdef CONFIG_PCI
 	if (ac97->pci) {
-		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_VENDOR_ID, &ac97->subsystem_vendor);
-		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_ID, &ac97->subsystem_device);
+		ac97->subsystem_vendor = ac97->pci->subsystem_vendor;
+		ac97->subsystem_device = ac97->pci->subsystem_device;
 	}
 #endif
 	if (bus->ops->reset) {
Signature · 1 line
1.5.5

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw

At Thu, 17 Jul 2008 14:24:32 +0200,

Quoted 6 lines · Rene Herman
Quoted 2 lines

From 01de5a42c7d5a0237895a476735028298203f30f Mon Sep 17 00:00:00 2001

From: Rene Herman <[email protected]>
Date: Thu, 17 Jul 2008 14:18:10 +0200
Subject: [PATCH] ALSA: ac97: copy subsys values from the PCI device

Quoted 6 lines

copy the subsys values from the PCI device instead of rereading them.

---
 sound/pci/ac97/ac97_codec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Well, it is still in that style just for laziness. Changing to this way requires the fix for 2.2/2.4 kernels, adding the chunk to the patch, etc.

Anyway I'll apply it later.

Thanks,

Takashi

Quoted 19 lines
sound/pci/ac97/ac97_codec.c +2 -2
index 45fd290..4f4343d 100644
@@ -2015,8 +2015,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
 
 #ifdef CONFIG_PCI
 	if (ac97->pci) {
-		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_VENDOR_ID, &ac97->subsystem_vendor);
-		pci_read_config_word(ac97->pci, PCI_SUBSYSTEM_ID, &ac97->subsystem_device);
+		ac97->subsystem_vendor = ac97->pci->subsystem_vendor;
+		ac97->subsystem_device = ac97->pci->subsystem_device;
 	}
 #endif
 	if (bus->ops->reset) {
Signature · 1 line
1.5.5
#2 lore raw
Quoted 5 lines · Takashi Iwai

Well, it is still in that style just for laziness. Changing to this way requires the fix for 2.2/2.4 kernels, adding the chunk to the patch, etc.

Anyway I'll apply it later.

Ah, I see. Don't bother changing it then I'd say. As said, just getting acquinted with the code...

Rene.