Skip to content

Commit

Permalink
r8169: use pci_dev->subsystem_{vendor|device}
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergei Shtylyov authored and David S. Miller committed Jul 23, 2011
1 parent 431bf99 commit ccbae55
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -2160,12 +2160,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);
Expand Down

0 comments on commit ccbae55

Please sign in to comment.