aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2016-09-06 17:38:45 -0400
committerKevin Hilman <khilman@baylibre.com>2016-09-07 17:13:13 -0400
commit1b0acbfdb8a8884f18fdb2caa85b4beded2390fb (patch)
tree6817743a03aab33547dc206bed8c594c86e9698c /drivers/net
parent6aee159712acf9585b3647bd5404a1db542bc518 (diff)
stmmac: introduce get_stmmac_bsp_priv() helper
Create a helper to retrieve dwmac private data from a dev pointer. This is useful in PM callbacks and driver remove. Signed-off-by: Joachim Eastwood <manabian@gmail.com> Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
index ffeb8d9e2b2e..64e147f53a9c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
@@ -30,4 +30,12 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
30int stmmac_pltfr_remove(struct platform_device *pdev); 30int stmmac_pltfr_remove(struct platform_device *pdev);
31extern const struct dev_pm_ops stmmac_pltfr_pm_ops; 31extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
32 32
33static inline void *get_stmmac_bsp_priv(struct device *dev)
34{
35 struct net_device *ndev = dev_get_drvdata(dev);
36 struct stmmac_priv *priv = netdev_priv(ndev);
37
38 return priv->plat->bsp_priv;
39}
40
33#endif /* __STMMAC_PLATFORM_H__ */ 41#endif /* __STMMAC_PLATFORM_H__ */