diff options
author | Joachim Eastwood <[email protected]> | 2016-09-06 23:38:45 +0200 |
---|---|---|
committer | Kevin Hilman <[email protected]> | 2016-09-07 14:13:13 -0700 |
commit | 1b0acbfdb8a8884f18fdb2caa85b4beded2390fb (patch) | |
tree | 6817743a03aab33547dc206bed8c594c86e9698c | |
parent | 6aee159712acf9585b3647bd5404a1db542bc518 (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 <[email protected]>
Tested-by: Martin Blumenstingl <[email protected]>
Acked-by: David S. Miller <[email protected]>
Signed-off-by: Kevin Hilman <[email protected]>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | 8 |
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__ */ |