提交 1b0acbfd 编写于 作者: J Joachim Eastwood 提交者: Kevin Hilman

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: NJoachim Eastwood <manabian@gmail.com>
Tested-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NKevin Hilman <khilman@baylibre.com>
上级 6aee1597
...@@ -30,4 +30,12 @@ int stmmac_get_platform_resources(struct platform_device *pdev, ...@@ -30,4 +30,12 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
int stmmac_pltfr_remove(struct platform_device *pdev); int stmmac_pltfr_remove(struct platform_device *pdev);
extern const struct dev_pm_ops stmmac_pltfr_pm_ops; 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__ */ #endif /* __STMMAC_PLATFORM_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册