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>
This commit is contained in:
Kai-Heng Feng 2022-01-14 15:14:30 +08:00 коммит произвёл David S. Miller
Родитель 99218cbf81
Коммит d90d0c175c
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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) {