mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
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>
This commit is contained in:
parent
6aee159712
commit
1b0acbfdb8
1 changed files with 8 additions and 0 deletions
|
@ -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__ */
|
||||
|
|
Loading…
Reference in a new issue