]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net: ethernet: wiznet: w5300: simplify getting .driver_data
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 21 Oct 2018 20:00:19 +0000 (22:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Oct 2018 04:10:12 +0000 (21:10 -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/wiznet/w5300.c

index 80fdbff67d82a7519a3a2eff210cb71c029ee126..f9da5d6172e389ac8d52b664008f188b158844b7 100644 (file)
@@ -661,8 +661,7 @@ static int w5300_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int w5300_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct net_device *ndev = platform_get_drvdata(pdev);
+       struct net_device *ndev = dev_get_drvdata(dev);
        struct w5300_priv *priv = netdev_priv(ndev);
 
        if (netif_running(ndev)) {
@@ -676,8 +675,7 @@ static int w5300_suspend(struct device *dev)
 
 static int w5300_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct net_device *ndev = platform_get_drvdata(pdev);
+       struct net_device *ndev = dev_get_drvdata(dev);
        struct w5300_priv *priv = netdev_priv(ndev);
 
        if (!netif_running(ndev)) {