Commit b82b2139 authored by Fuqian Huang's avatar Fuqian Huang Committed by David S. Miller

net/ethernet: using dev_get_drvdata directly

Several drivers cast a struct device pointer to a struct
platform_device pointer only to then call platform_get_drvdata().
To improve readability, these constructs can be simplified
by using dev_get_drvdata() directly.
Signed-off-by: default avatarFuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 233cc605
...@@ -1855,7 +1855,7 @@ static void xgmac_pmt(void __iomem *ioaddr, unsigned long mode) ...@@ -1855,7 +1855,7 @@ static void xgmac_pmt(void __iomem *ioaddr, unsigned long mode)
static int xgmac_suspend(struct device *dev) static int xgmac_suspend(struct device *dev)
{ {
struct net_device *ndev = platform_get_drvdata(to_platform_device(dev)); struct net_device *ndev = dev_get_drvdata(dev);
struct xgmac_priv *priv = netdev_priv(ndev); struct xgmac_priv *priv = netdev_priv(ndev);
u32 value; u32 value;
...@@ -1881,7 +1881,7 @@ static int xgmac_suspend(struct device *dev) ...@@ -1881,7 +1881,7 @@ static int xgmac_suspend(struct device *dev)
static int xgmac_resume(struct device *dev) static int xgmac_resume(struct device *dev)
{ {
struct net_device *ndev = platform_get_drvdata(to_platform_device(dev)); struct net_device *ndev = dev_get_drvdata(dev);
struct xgmac_priv *priv = netdev_priv(ndev); struct xgmac_priv *priv = netdev_priv(ndev);
void __iomem *ioaddr = priv->base; void __iomem *ioaddr = priv->base;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment