diff mbox

bt8xx: use pci_dev->subsystem_{vendor|device}

Message ID 201107222216.04703.sshtylyov@ru.mvista.com (mailing list archive)
State Accepted
Headers show

Commit Message

Sergei Shtylyov July 22, 2011, 6:16 p.m. UTC
The driver reads PCI subsystem IDs from the PCI configuration registers while
they are already stored by the PCI subsystem in the 'subsystem_{vendor|device}'
fields of 'struct pci_dev'...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
The patch is against the recent Linus' tree.

 drivers/media/video/bt8xx/bttv-cards.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux-2.6/drivers/media/video/bt8xx/bttv-cards.c
===================================================================
--- linux-2.6.orig/drivers/media/video/bt8xx/bttv-cards.c
+++ linux-2.6/drivers/media/video/bt8xx/bttv-cards.c
@@ -2892,13 +2892,10 @@  void __devinit bttv_idcard(struct bttv *
 {
 	unsigned int gpiobits;
 	int i,type;
-	unsigned short tmp;
 
 	/* read PCI subsystem ID */
-	pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
-	btv->cardid = tmp << 16;
-	pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
-	btv->cardid |= tmp;
+	btv->cardid  = btv->c.pci->subsystem_device << 16;
+	btv->cardid |= btv->c.pci->subsystem_vendor;
 
 	if (0 != btv->cardid && 0xffffffff != btv->cardid) {
 		/* look for the card */