From: John W. Linville Date: Wed, 24 Aug 2011 18:08:41 +0000 (-0400) Subject: ath9k: remove replicated null check in ath_pci_aspm_init X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=22c55e6e7ed46ad3734c206d90b5ccba3b318d22;p=linux-beck.git ath9k: remove replicated null check in ath_pci_aspm_init Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index d704c8d9bae7..91c2e64de799 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c @@ -115,6 +115,8 @@ static void ath_pci_aspm_init(struct ath_common *common) return; parent = pdev->bus->self; + if (!parent) + return; if (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) { /* Bluetooth coexistance requires disabling ASPM. */ @@ -126,9 +128,6 @@ static void ath_pci_aspm_init(struct ath_common *common) * Both upstream and downstream PCIe components should * have the same ASPM settings. */ - if (!parent) - return; - pos = pci_pcie_cap(parent); pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm); aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1); @@ -137,9 +136,6 @@ static void ath_pci_aspm_init(struct ath_common *common) return; } - if (!parent) - return; - pos = pci_pcie_cap(parent); pci_read_config_byte(parent, pos + PCI_EXP_LNKCTL, &aspm); if (aspm & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)) {