[PATCH 2/3] staging: brcm80211: making device object accessible from wlc and phy

Roland Vossen rvossen at broadcom.com
Fri Apr 22 00:46:25 PDT 2011


Hi guys,

> Yes, why would a normal driver ever mess with a "raw" kobject or struct
> device?  They would use the standard functions to properly handle this
> type of reference counting depending on their subsystem type (hint, you
> should be doing this from the network device structure functions...)

The 'why' I want to mess with struct device in my driver is that the alternative is to include cfg80211.h in every brc80211 source file that does message logging, which is a form of coupling that I think is ugly. In this alternative, I would have to use wiphy_err() and friends. 

wiphy_err() is defined as:

#define wiphy_err(wiphy, format, args...)                       \
        dev_err(&(wiphy)->dev, format, ##args)

(ref: http://lxr.linux.no/#linux+v2.6.38/include/net/cfg80211.h#L2719).

An alternative would be if these message logging macro's (wiphy_err() etc) would be moved to a separate include file. 

Thanks, Roland.


More information about the devel mailing list