summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2016-09-06 23:38:45 +0200
committerKevin Hilman <khilman@baylibre.com>2016-09-07 14:13:13 -0700
commit1b0acbfdb8a8884f18fdb2caa85b4beded2390fb (patch)
tree6817743a03aab33547dc206bed8c594c86e9698c /drivers/net
parent6aee159712acf9585b3647bd5404a1db542bc518 (diff)
downloadlinux-stable-1b0acbfdb8a8884f18fdb2caa85b4beded2390fb.tar.gz
linux-stable-1b0acbfdb8a8884f18fdb2caa85b4beded2390fb.tar.bz2
linux-stable-1b0acbfdb8a8884f18fdb2caa85b4beded2390fb.zip
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,
int stmmac_pltfr_remove(struct platform_device *pdev);
extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
+static inline void *get_stmmac_bsp_priv(struct device *dev)
+{
+ struct net_device *ndev = dev_get_drvdata(dev);
+ struct stmmac_priv *priv = netdev_priv(ndev);
+
+ return priv->plat->bsp_priv;
+}
+
#endif /* __STMMAC_PLATFORM_H__ */