[media] bt8xx: use pci_dev->subsystem_{vendor|device}
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Fri, 22 Jul 2011 18:16:04 +0000 (15:16 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:56:04 +0000 (17:56 -0300)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/bt8xx/bttv-cards.c

index 3c9e6c7e7b52313b82a229535fc23d7962fbfc62..5b15f63bf065cc8646753c5e1dc6f9c19d348da0 100644 (file)
@@ -2892,13 +2892,10 @@ void __devinit bttv_idcard(struct bttv *btv)
 {
        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 */