Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c0280bd authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Johannes Berg
Browse files

wireless: make the reg_notifier() void



The reg_notifier()'s return value need not be checked
as it is only supposed to do post regulatory work and
that should never fail. Any behaviour to regulatory
that needs to be considered before cfg80211 does work
to a driver should be specified by using the already
existing flags, the reg_notifier() just does post
processing should it find it needs to.

Also make lbs_reg_notifier static.

Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
[move lbs_reg_notifier to not break compile]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 55b183ad
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -240,13 +240,14 @@ static const struct ath_ops ath5k_common_ops = {
* Driver Initialization *
\***********************/

static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
static void ath5k_reg_notifier(struct wiphy *wiphy,
			       struct regulatory_request *request)
{
	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
	struct ath5k_hw *ah = hw->priv;
	struct ath_regulatory *regulatory = ath5k_hw_regulatory(ah);

	return ath_reg_notifier_apply(wiphy, request, regulatory);
	ath_reg_notifier_apply(wiphy, request, regulatory);
}

/********************\
+5 −11
Original line number Diff line number Diff line
@@ -3492,7 +3492,7 @@ void ath6kl_cfg80211_stop_all(struct ath6kl *ar)
		ath6kl_cfg80211_stop(vif);
}

static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
static void ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
				       struct regulatory_request *request)
{
	struct ath6kl *ar = wiphy_priv(wiphy);
@@ -3506,17 +3506,13 @@ static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
		   request->processed ? " processed" : "",
		   request->initiator, request->user_reg_hint_type);

	/*
	 * As firmware is not able intersect regdoms, we can only listen to
	 * cellular hints.
	 */
	if (request->user_reg_hint_type != NL80211_USER_REG_HINT_CELL_BASE)
		return -EOPNOTSUPP;
		return;

	ret = ath6kl_wmi_set_regdomain_cmd(ar->wmi, request->alpha2);
	if (ret) {
		ath6kl_err("failed to set regdomain: %d\n", ret);
		return ret;
		return;
	}

	/*
@@ -3536,10 +3532,8 @@ static int ath6kl_cfg80211_reg_notify(struct wiphy *wiphy,
	if (ret) {
		ath6kl_err("failed to start scan for a regdomain change: %d\n",
			   ret);
		return ret;
		return;
	}

	return 0;
}

static int ath6kl_cfg80211_vif_init(struct ath6kl_vif *vif)
+4 −4
Original line number Diff line number Diff line
@@ -280,13 +280,13 @@ static int ath9k_init_htc_services(struct ath9k_htc_priv *priv, u16 devid,
	return ret;
}

static int ath9k_reg_notifier(struct wiphy *wiphy,
static void ath9k_reg_notifier(struct wiphy *wiphy,
			       struct regulatory_request *request)
{
	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
	struct ath9k_htc_priv *priv = hw->priv;

	return ath_reg_notifier_apply(wiphy, request,
	ath_reg_notifier_apply(wiphy, request,
			       ath9k_hw_regulatory(priv->ah));
}

+3 −6
Original line number Diff line number Diff line
@@ -302,16 +302,15 @@ static void setup_ht_cap(struct ath_softc *sc,
	ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_DEFINED;
}

static int ath9k_reg_notifier(struct wiphy *wiphy,
static void ath9k_reg_notifier(struct wiphy *wiphy,
			       struct regulatory_request *request)
{
	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
	struct ath_softc *sc = hw->priv;
	struct ath_hw *ah = sc->sc_ah;
	struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
	int ret;

	ret = ath_reg_notifier_apply(wiphy, request, reg);
	ath_reg_notifier_apply(wiphy, request, reg);

	/* Set tx power */
	if (ah->curchan) {
@@ -321,8 +320,6 @@ static int ath9k_reg_notifier(struct wiphy *wiphy,
		sc->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
		ath9k_ps_restore(sc);
	}

	return ret;
}

/*
+3 −3
Original line number Diff line number Diff line
@@ -1918,13 +1918,13 @@ static int carl9170_parse_eeprom(struct ar9170 *ar)
	return 0;
}

static int carl9170_reg_notifier(struct wiphy *wiphy,
static void carl9170_reg_notifier(struct wiphy *wiphy,
				  struct regulatory_request *request)
{
	struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
	struct ar9170 *ar = hw->priv;

	return ath_reg_notifier_apply(wiphy, request, &ar->common.regulatory);
	ath_reg_notifier_apply(wiphy, request, &ar->common.regulatory);
}

int carl9170_register(struct ar9170 *ar)
Loading