Skip to content

Commit d90d0c1

Browse files
khfengdavem330
authored andcommitted
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>
1 parent 99218cb commit d90d0c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7159,7 +7159,8 @@ int stmmac_dvr_probe(struct device *device,
71597159

71607160
pm_runtime_get_noresume(device);
71617161
pm_runtime_set_active(device);
7162-
pm_runtime_enable(device);
7162+
if (!pm_runtime_enabled(device))
7163+
pm_runtime_enable(device);
71637164

71647165
if (priv->hw->pcs != STMMAC_PCS_TBI &&
71657166
priv->hw->pcs != STMMAC_PCS_RTBI) {

0 commit comments

Comments
 (0)