regulatory: use IS_ERR macro family for freq_reg_info
Instead of returning an error and filling a pointer return the pointer and an ERR_PTR value in error cases. Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -2938,22 +2938,22 @@ extern void wiphy_apply_custom_regulatory(
|
||||
* freq_reg_info - get regulatory information for the given frequency
|
||||
* @wiphy: the wiphy for which we want to process this rule for
|
||||
* @center_freq: Frequency in KHz for which we want regulatory information for
|
||||
* @reg_rule: the regulatory rule which we have for this frequency
|
||||
*
|
||||
* Use this function to get the regulatory rule for a specific frequency on
|
||||
* a given wireless device. If the device has a specific regulatory domain
|
||||
* it wants to follow we respect that unless a country IE has been received
|
||||
* and processed already.
|
||||
*
|
||||
* Returns 0 if it was able to find a valid regulatory rule which does
|
||||
* apply to the given center_freq otherwise it returns non-zero. It will
|
||||
* also return -ERANGE if we determine the given center_freq does not even have
|
||||
* a regulatory rule for a frequency range in the center_freq's band. See
|
||||
* freq_in_rule_band() for our current definition of a band -- this is purely
|
||||
* subjective and right now its 802.11 specific.
|
||||
* When an error occurs, for example if no rule can be found, the return value
|
||||
* is encoded using ERR_PTR(). Use IS_ERR() to check and PTR_ERR() to obtain
|
||||
* the numeric return value. The numeric return value will be -ERANGE if we
|
||||
* determine the given center_freq does not even have a regulatory rule for a
|
||||
* frequency range in the center_freq's band. See freq_in_rule_band() for our
|
||||
* current definition of a band -- this is purely subjective and right now it's
|
||||
* 802.11 specific.
|
||||
*/
|
||||
extern int freq_reg_info(struct wiphy *wiphy, u32 center_freq,
|
||||
const struct ieee80211_reg_rule **reg_rule);
|
||||
const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
|
||||
u32 center_freq);
|
||||
|
||||
/*
|
||||
* callbacks for asynchronous cfg80211 methods, notification
|
||||
|
Reference in New Issue
Block a user