r8169: use dev_get_drvdata where possible
Using dev_get_drvdata directly is simpler here. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fe716f8a33
commit
0f07bd850d
|
@ -6819,8 +6819,7 @@ static void rtl8169_net_suspend(struct net_device *dev)
|
|||
|
||||
static int rtl8169_suspend(struct device *device)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(device);
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct rtl8169_private *tp = netdev_priv(dev);
|
||||
|
||||
rtl8169_net_suspend(dev);
|
||||
|
@ -6850,8 +6849,7 @@ static void __rtl8169_resume(struct net_device *dev)
|
|||
|
||||
static int rtl8169_resume(struct device *device)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(device);
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct rtl8169_private *tp = netdev_priv(dev);
|
||||
|
||||
clk_prepare_enable(tp->clk);
|
||||
|
@ -6864,8 +6862,7 @@ static int rtl8169_resume(struct device *device)
|
|||
|
||||
static int rtl8169_runtime_suspend(struct device *device)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(device);
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct rtl8169_private *tp = netdev_priv(dev);
|
||||
|
||||
if (!tp->TxDescArray)
|
||||
|
@ -6886,8 +6883,7 @@ static int rtl8169_runtime_suspend(struct device *device)
|
|||
|
||||
static int rtl8169_runtime_resume(struct device *device)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(device);
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
struct rtl8169_private *tp = netdev_priv(dev);
|
||||
rtl_rar_set(tp, dev->dev_addr);
|
||||
|
||||
|
@ -6905,8 +6901,7 @@ static int rtl8169_runtime_resume(struct device *device)
|
|||
|
||||
static int rtl8169_runtime_idle(struct device *device)
|
||||
{
|
||||
struct pci_dev *pdev = to_pci_dev(device);
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct net_device *dev = dev_get_drvdata(device);
|
||||
|
||||
if (!netif_running(dev) || !netif_carrier_ok(dev))
|
||||
pm_schedule_suspend(device, 10000);
|
||||
|
|
Loading…
Reference in New Issue