Skip to content

Commit

Permalink
net: stmmac: Fix "Unbalanced pm_runtime_enable!" warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kai-Heng Feng authored and David S. Miller committed Jan 14, 2022
1 parent 99218cb commit d90d0c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d90d0c1

Please sign in to comment.