From: Dmitry Kravkov Date: Sun, 17 Oct 2010 23:10:02 +0000 (+0000) Subject: bnx2x: do not deal with power if no capability X-Git-Tag: MMI-PSA29.97-13-9~21994^2~104 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=adf5f6a18f2cbb215394599981fb48473b526faa;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git bnx2x: do not deal with power if no capability Signed-off-by: Dmitry Kravkov Signed-off-by: Vladislav Zolotarov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index b037dd2db8e5..afff58c52d4f 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c @@ -1521,6 +1521,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) {