Commit ac8bd9e1 authored by Hans de Goede's avatar Hans de Goede Committed by David S. Miller

r8169: Disable clk during suspend / resume

Disable the clk during suspend to save power. Note that tp->clk may be
NULL, the clk core functions handle this without problems.
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarCarlo Caione <carlo@endlessm.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c333fa0c
...@@ -6869,8 +6869,10 @@ static int rtl8169_suspend(struct device *device) ...@@ -6869,8 +6869,10 @@ static int rtl8169_suspend(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct rtl8169_private *tp = netdev_priv(dev);
rtl8169_net_suspend(dev); rtl8169_net_suspend(dev);
clk_disable_unprepare(tp->clk);
return 0; return 0;
} }
...@@ -6898,6 +6900,9 @@ static int rtl8169_resume(struct device *device) ...@@ -6898,6 +6900,9 @@ static int rtl8169_resume(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct rtl8169_private *tp = netdev_priv(dev);
clk_prepare_enable(tp->clk);
if (netif_running(dev)) if (netif_running(dev))
__rtl8169_resume(dev); __rtl8169_resume(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment