summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorKai-Heng Feng <kai.heng.feng@canonical.com>2022-01-14 10:14:30 +0300
committerDavid S. Miller <davem@davemloft.net>2022-01-14 14:27:34 +0300
commitd90d0c175cf2982789d336dda928c0f69d3e8a9d (patch)
treeabc5f65563a8871e302370ab47c8a2693ac4360f /drivers/net/ethernet
parent99218cbf81bf21355a3de61cd46a706d36e900e6 (diff)
downloadlinux-d90d0c175cf2982789d336dda928c0f69d3e8a9d.tar.xz
net: stmmac: Fix "Unbalanced pm_runtime_enable!" warning
If the device is PCI based like intel-eth-pci, pm_runtime_enable() is already called by pci_pm_init(). So only pm_runtime_enable() when it's not already enabled. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 63ff2dad8c85..6708ca2aa4f7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7159,7 +7159,8 @@ int stmmac_dvr_probe(struct device *device,
pm_runtime_get_noresume(device);
pm_runtime_set_active(device);
- pm_runtime_enable(device);
+ if (!pm_runtime_enabled(device))
+ pm_runtime_enable(device);
if (priv->hw->pcs != STMMAC_PCS_TBI &&
priv->hw->pcs != STMMAC_PCS_RTBI) {