mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-30 07:34:12 +08:00
net: ethernet: wiznet: w5300: 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
762b9e9abb
commit
44f5ccdbc9
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user