]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
r8169: use pci_dev->subsystem_{vendor|device}
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Fri, 22 Jul 2011 05:37:24 +0000 (05:37 +0000)
committerJoe Jin <joe.jin@oracle.com>
Fri, 18 May 2012 02:03:14 +0000 (10:03 +0800)
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: David S. Miller <davem@davemloft.net>
(cherry picked from commit ccbae55e1c6dc18e95d72c044cf9345ea08abf7b)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/r8169.c

index 92f4dad69f5643147cfc25b330155bae0942dacc..40c77688bd6e8b82bdb2354f4970c90cac72b411 100644 (file)
@@ -2066,12 +2066,9 @@ static void rtl8169sb_hw_phy_config(struct rtl8169_private *tp)
 static void rtl8169scd_hw_phy_config_quirk(struct rtl8169_private *tp)
 {
        struct pci_dev *pdev = tp->pci_dev;
-       u16 vendor_id, device_id;
 
-       pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &vendor_id);
-       pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &device_id);
-
-       if ((vendor_id != PCI_VENDOR_ID_GIGABYTE) || (device_id != 0xe000))
+       if ((pdev->subsystem_vendor != PCI_VENDOR_ID_GIGABYTE) ||
+           (pdev->subsystem_device != 0xe000))
                return;
 
        rtl_writephy(tp, 0x1f, 0x0001);