Skip to content

Commit 92bad85

Browse files
hkallweitdavem330
authored andcommitted
r8169: improve phy initialization when resuming
Let's move calling rtl8169_init_phy() to __rtl8169_resume(). It simplifies the code and avoids rtl8169_init_phy() being called when resuming whilst interface is down. rtl_open() will initialize the PHY when the interface is brought up. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 064f390 commit 92bad85

File tree

1 file changed

+1
-5
lines changed
  • drivers/net/ethernet/realtek

1 file changed

+1
-5
lines changed

drivers/net/ethernet/realtek/r8169.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7334,6 +7334,7 @@ static void __rtl8169_resume(struct net_device *dev)
73347334
netif_device_attach(dev);
73357335

73367336
rtl_pll_power_up(tp);
7337+
rtl8169_init_phy(dev, tp);
73377338

73387339
rtl_lock_work(tp);
73397340
napi_enable(&tp->napi);
@@ -7347,9 +7348,6 @@ static int rtl8169_resume(struct device *device)
73477348
{
73487349
struct pci_dev *pdev = to_pci_dev(device);
73497350
struct net_device *dev = pci_get_drvdata(pdev);
7350-
struct rtl8169_private *tp = netdev_priv(dev);
7351-
7352-
rtl8169_init_phy(dev, tp);
73537351

73547352
if (netif_running(dev))
73557353
__rtl8169_resume(dev);
@@ -7397,8 +7395,6 @@ static int rtl8169_runtime_resume(struct device *device)
73977395
tp->saved_wolopts = 0;
73987396
rtl_unlock_work(tp);
73997397

7400-
rtl8169_init_phy(dev, tp);
7401-
74027398
__rtl8169_resume(dev);
74037399

74047400
return 0;

0 commit comments

Comments
 (0)