Skip to content

Commit

Permalink
stmmac: introduce get_stmmac_bsp_priv() helper
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
manabian authored and khilman committed Sep 7, 2016
1 parent 6aee159 commit 1b0acbf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit 1b0acbf

Please sign in to comment.