net: macb: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 19 Mar 2019 16:36:34 +0000 (17:36 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Mar 2019 21:28:55 +0000 (14:28 -0700)
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>
drivers/net/ethernet/cadence/macb_main.c

index ad099fd..98c2352 100644 (file)
@@ -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))) {