From: David Kilroy Date: Thu, 18 Jun 2009 22:21:13 +0000 (+0100) Subject: cfg80211: add wrapper function to get wiphy from priv pointer X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=f1f74825fe01ac77204ca34e3240dec50a8207c2;p=openwrt%2Fstaging%2Fblogic.git cfg80211: add wrapper function to get wiphy from priv pointer Signed-off-by: David Kilroy Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 90f9bfa3bfc2..dba7874d1963 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1058,6 +1058,17 @@ static inline void *wiphy_priv(struct wiphy *wiphy) return &wiphy->priv; } +/** + * priv_to_wiphy - return the wiphy containing the priv + * + * @priv: a pointer previously returned by wiphy_priv + */ +static inline struct wiphy *priv_to_wiphy(void *priv) +{ + BUG_ON(!priv); + return container_of(priv, struct wiphy, priv); +} + /** * set_wiphy_dev - set device pointer for wiphy *