diff options
author | Kai-Heng Feng | 2022-01-14 15:14:30 +0800 |
---|---|---|
committer | David S. Miller | 2022-01-14 11:27:34 +0000 |
commit | d90d0c175cf2982789d336dda928c0f69d3e8a9d (patch) | |
tree | abc5f65563a8871e302370ab47c8a2693ac4360f /drivers/net | |
parent | 99218cbf81bf21355a3de61cd46a706d36e900e6 (diff) |
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')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 |
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) { |