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

Commit 84c87dc8 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by John W. Linville
Browse files

ath9k: remove ->config_pci_powersave() redundant argument



We always call ->config_pci_powersave() with both restore and power_off
arguments equal to 0 or both equal to 1, so merge them into one
argument.

Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent af2bf4b4
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -303,8 +303,7 @@ static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
 * register as the other analog registers.  Hence the 9 writes.
 */
static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
					 int restore,
					 int power_off)
					 bool power_off)
{
	u8 i;
	u32 val;
@@ -313,7 +312,7 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
		return;

	/* Nothing to do on restore for 11N */
	if (!restore) {
	if (!power_off /* !restore */) {
		if (AR_SREV_9280_20_OR_LATER(ah)) {
			/*
			 * AR9280 2.0 or later chips use SerDes values from the
+2 −3
Original line number Diff line number Diff line
@@ -516,14 +516,13 @@ static void ar9003_hw_init_mode_gain_regs(struct ath_hw *ah)
 * register as the other analog registers.  Hence the 9 writes.
 */
static void ar9003_hw_configpcipowersave(struct ath_hw *ah,
					 int restore,
					 int power_off)
					 bool power_off)
{
	if (ah->is_pciexpress != true || ah->aspm_enabled != true)
		return;

	/* Nothing to do on restore for 11N */
	if (!restore) {
	if (!power_off /* !restore */) {
		/* set bit 19 to allow forcing of pcie core into L1 state */
		REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA);

+2 −3
Original line number Diff line number Diff line
@@ -22,10 +22,9 @@
/* Hardware core and driver accessible callbacks */

static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah,
					       int restore,
					       int power_off)
					       bool power_off)
{
	ath9k_hw_ops(ah)->config_pci_powersave(ah, restore, power_off);
	ath9k_hw_ops(ah)->config_pci_powersave(ah, power_off);
}

static inline void ath9k_hw_rxena(struct ath_hw *ah)
+1 −2
Original line number Diff line number Diff line
@@ -606,8 +606,7 @@ struct ath_hw_private_ops {
 */
struct ath_hw_ops {
	void (*config_pci_powersave)(struct ath_hw *ah,
				     int restore,
				     int power_off);
				     bool power_off);
	void (*rx_enable)(struct ath_hw *ah);
	void (*set_desc_link)(void *ds, u32 link);
	bool (*calibrate)(struct ath_hw *ah,
+3 −3
Original line number Diff line number Diff line
@@ -888,7 +888,7 @@ static void ath_radio_enable(struct ath_softc *sc, struct ieee80211_hw *hw)
	spin_lock_bh(&sc->sc_pcu_lock);
	atomic_set(&ah->intr_ref_cnt, -1);

	ath9k_hw_configpcipowersave(ah, 0, 0);
	ath9k_hw_configpcipowersave(ah, false);

	if (!ah->curchan)
		ah->curchan = ath9k_cmn_get_curchannel(sc->hw, ah);
@@ -969,7 +969,7 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)

	ath9k_hw_phy_disable(ah);

	ath9k_hw_configpcipowersave(ah, 1, 1);
	ath9k_hw_configpcipowersave(ah, true);

	spin_unlock_bh(&sc->sc_pcu_lock);
	ath9k_ps_restore(sc);
@@ -1069,7 +1069,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
	init_channel = ath9k_cmn_get_curchannel(hw, ah);

	/* Reset SERDES registers */
	ath9k_hw_configpcipowersave(ah, 0, 0);
	ath9k_hw_configpcipowersave(ah, false);

	/*
	 * The basic interface to setting the hardware in a good
Loading