提交 ce886a47 编写于 作者: W Wolfram Sang 提交者: David S. Miller

net: ethernet: cadence: macb_main: simplify getting .driver_data

We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 717de370
...@@ -4156,8 +4156,7 @@ static int macb_remove(struct platform_device *pdev) ...@@ -4156,8 +4156,7 @@ static int macb_remove(struct platform_device *pdev)
static int __maybe_unused macb_suspend(struct device *dev) static int __maybe_unused macb_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct net_device *netdev = dev_get_drvdata(dev);
struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev); struct macb *bp = netdev_priv(netdev);
netif_carrier_off(netdev); netif_carrier_off(netdev);
...@@ -4179,8 +4178,7 @@ static int __maybe_unused macb_suspend(struct device *dev) ...@@ -4179,8 +4178,7 @@ static int __maybe_unused macb_suspend(struct device *dev)
static int __maybe_unused macb_resume(struct device *dev) static int __maybe_unused macb_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct net_device *netdev = dev_get_drvdata(dev);
struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev); struct macb *bp = netdev_priv(netdev);
if (bp->wol & MACB_WOL_ENABLED) { if (bp->wol & MACB_WOL_ENABLED) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册