mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-01 19:34:35 +08:00
net: macb: 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: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
64c4052584
commit
f9cb75970e
@ -4354,8 +4354,7 @@ static int __maybe_unused macb_resume(struct device *dev)
|
||||
|
||||
static int __maybe_unused macb_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct net_device *netdev = platform_get_drvdata(pdev);
|
||||
struct net_device *netdev = dev_get_drvdata(dev);
|
||||
struct macb *bp = netdev_priv(netdev);
|
||||
|
||||
if (!(device_may_wakeup(&bp->dev->dev))) {
|
||||
@ -4371,8 +4370,7 @@ static int __maybe_unused macb_runtime_suspend(struct device *dev)
|
||||
|
||||
static int __maybe_unused macb_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct net_device *netdev = platform_get_drvdata(pdev);
|
||||
struct net_device *netdev = dev_get_drvdata(dev);
|
||||
struct macb *bp = netdev_priv(netdev);
|
||||
|
||||
if (!(device_may_wakeup(&bp->dev->dev))) {
|
||||
|
Loading…
Reference in New Issue
Block a user