Skip to contentSkip to conversation

bnx2x: do not deal with power if no capability

PATCH In review Dmitry Kravkov 1 participant 1 message Oct 10, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/5 bnx2x: do not deal with power if no capability

---
 drivers/net/bnx2x/bnx2x_cmn.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/bnx2x/bnx2x_cmn.c +6 -0
index 3f0540c..9a3208e 100644
@@ -1520,6 +1520,12 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
 {
 	u16 pmcsr;
 
+	/* If there is no power capability, silently succeed */
+	if (!bp->pm_cap) {
+		DP(NETIF_MSG_HW, "No power capability. Breaking.\n");
+		return 0;
+	}
+
 	pci_read_config_word(bp->pdev, bp->pm_cap + PCI_PM_CTRL, &pmcsr);
 
 	switch (state) {
Signature · 1 line
1.7.1