diff options
author | Joachim Eastwood <manabian@gmail.com> | 2016-09-06 23:38:45 +0200 |
---|---|---|
committer | Kevin Hilman <khilman@baylibre.com> | 2016-09-07 14:13:13 -0700 |
commit | 1b0acbfdb8a8884f18fdb2caa85b4beded2390fb (patch) | |
tree | 6817743a03aab33547dc206bed8c594c86e9698c /drivers/net | |
parent | 6aee159712acf9585b3647bd5404a1db542bc518 (diff) | |
download | linux-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.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__ */ |