rtlwifi: remove unnecessary read of PCI_CAP_ID_EXP
authorJon Mason <jdmason@kudzu.us>
Mon, 27 Jun 2011 17:50:14 +0000 (12:50 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 29 Jun 2011 19:10:59 +0000 (15:10 -0400)
The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Also, remove unnecessary and unused #defines for PCI.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/pci.h

index 6a15f368ebb97935af0e876c5ff9b79f333c9204..aa0ba9ec6aa9601bd4cbbe086e4406cee5a1a36f 100644 (file)
@@ -390,7 +390,7 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev,
        u8 linkctrl_reg;
 
        /*Link Control Register */
-       pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
+       pos = pci_pcie_cap(pdev);
        pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg);
        pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg;
 
index 671b1f5aa0cff1d351dd04de85033db63dbc3857..76f42005a118902a6a41e7fb1b3092615265fe22 100644 (file)
 #define PCI_CONF_ADDRESS       0x0CF8  /*PCI Configuration Space Address */
 #define PCI_CONF_DATA          0x0CFC  /*PCI Configuration Space Data */
 
-#define PCI_CLASS_BRIDGE_DEV           0x06
-#define PCI_SUBCLASS_BR_PCI_TO_PCI     0x04
-#define PCI_CAPABILITY_ID_PCI_EXPRESS  0x10
-#define PCI_CAP_ID_EXP                 0x10
-
 #define U1DONTCARE                     0xFF
 #define U2DONTCARE                     0xFFFF
 #define U4DONTCARE                     0xFFFFFFFF