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

Commit 9597ebac authored by Johannes Berg's avatar Johannes Berg Committed by Wey-Yi Guy
Browse files

iwlwifi: remove set_pwr_src operation



The set_pwr_src operation is only ever used from
within the same sub-driver that it is declared
in, so it can just be called directly instead of
being an operation. Also, it is never called to
set the power source to V_aux, so change the two
functions accordingly (but keep the V_aux code
for documentation purposes in a comment).

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
parent 0453674c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ static struct iwl_lib_ops iwl1000_lib = {
		.init = iwl_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl1000_nic_config,
		.set_pwr_src = iwl_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
+12 −14
Original line number Diff line number Diff line
@@ -816,9 +816,12 @@ static u8 iwl3945_sync_sta(struct iwl_priv *priv, int sta_id, u16 tx_rate)
	return sta_id;
}

static int iwl3945_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)
static void iwl3945_set_pwr_vmain(struct iwl_priv *priv)
{
	if (src == IWL_PWR_SRC_VAUX) {
/*
 * (for documentation purposes)
 * to set power to V_AUX, do

		if (pci_pme_capable(priv->pci_dev, PCI_D3cold)) {
			iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
					APMG_PS_CTRL_VAL_PWR_SRC_VAUX,
@@ -828,7 +831,8 @@ static int iwl3945_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)
				     CSR_GPIO_IN_VAL_VAUX_PWR_SRC,
				     CSR_GPIO_IN_BIT_AUX_POWER, 5000);
		}
	} else {
 */

	iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG,
			APMG_PS_CTRL_VAL_PWR_SRC_VMAIN,
			~APMG_PS_CTRL_MSK_PWR_SRC);
@@ -837,9 +841,6 @@ static int iwl3945_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src)
		     CSR_GPIO_IN_BIT_AUX_POWER, 5000);	/* uS */
}

	return 0;
}

static int iwl3945_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
{
	iwl_write_direct32(priv, FH39_RCSR_RBD_BASE(0), rxq->bd_dma);
@@ -1031,9 +1032,7 @@ int iwl3945_hw_nic_init(struct iwl_priv *priv)
	priv->cfg->ops->lib->apm_ops.init(priv);
	spin_unlock_irqrestore(&priv->lock, flags);

	rc = priv->cfg->ops->lib->apm_ops.set_pwr_src(priv, IWL_PWR_SRC_VMAIN);
	if (rc)
		return rc;
	iwl3945_set_pwr_vmain(priv);

	priv->cfg->ops->lib->apm_ops.config(priv);

@@ -2707,7 +2706,6 @@ static struct iwl_lib_ops iwl3945_lib = {
		.init = iwl3945_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl3945_nic_config,
		.set_pwr_src = iwl3945_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
+0 −1
Original line number Diff line number Diff line
@@ -2268,7 +2268,6 @@ static struct iwl_lib_ops iwl4965_lib = {
		.init = iwl_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl4965_nic_config,
		.set_pwr_src = iwl_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
+0 −2
Original line number Diff line number Diff line
@@ -370,7 +370,6 @@ static struct iwl_lib_ops iwl5000_lib = {
		.init = iwl_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl5000_nic_config,
		.set_pwr_src = iwl_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
@@ -440,7 +439,6 @@ static struct iwl_lib_ops iwl5150_lib = {
		.init = iwl_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl5000_nic_config,
		.set_pwr_src = iwl_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
+0 −2
Original line number Diff line number Diff line
@@ -310,7 +310,6 @@ static struct iwl_lib_ops iwl6000_lib = {
		.init = iwl_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl6000_nic_config,
		.set_pwr_src = iwl_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
@@ -383,7 +382,6 @@ static struct iwl_lib_ops iwl6000g2b_lib = {
		.init = iwl_apm_init,
		.stop = iwl_apm_stop,
		.config = iwl6000_nic_config,
		.set_pwr_src = iwl_set_pwr_src,
	},
	.eeprom_ops = {
		.regulatory_bands = {
Loading