aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-05 12:42:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:51:39 -0400
commite98a130259ed6f88bc2833fa525b10453c92c047 (patch)
tree067f8b8d3421e4e7e2fd5a31e089c3a3caaf4965 /drivers/net
parentbc255930639122d788d1b6ce10d3c01cc2946398 (diff)
iwlagn: remove hw_rev
The hw_rev variable is used only during init, so there's no need to keep it around. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 55a1d65c4baf..c3306bae0f1e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3685,11 +3685,11 @@ struct ieee80211_ops iwlagn_hw_ops = {
3685 .offchannel_tx_cancel_wait = iwl_mac_offchannel_tx_cancel_wait, 3685 .offchannel_tx_cancel_wait = iwl_mac_offchannel_tx_cancel_wait,
3686}; 3686};
3687 3687
3688static void iwl_hw_detect(struct iwl_priv *priv) 3688static u32 iwl_hw_detect(struct iwl_priv *priv)
3689{ 3689{
3690 priv->hw_rev = _iwl_read32(priv, CSR_HW_REV);
3691 priv->rev_id = priv->pci_dev->revision; 3690 priv->rev_id = priv->pci_dev->revision;
3692 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", priv->rev_id); 3691 IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", priv->rev_id);
3692 return _iwl_read32(priv, CSR_HW_REV);
3693} 3693}
3694 3694
3695static int iwl_set_hw_params(struct iwl_priv *priv) 3695static int iwl_set_hw_params(struct iwl_priv *priv)
@@ -3740,6 +3740,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3740 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); 3740 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
3741 unsigned long flags; 3741 unsigned long flags;
3742 u16 pci_cmd, num_mac; 3742 u16 pci_cmd, num_mac;
3743 u32 hw_rev;
3743 3744
3744 /************************ 3745 /************************
3745 * 1. Allocating HW data 3746 * 1. Allocating HW data
@@ -3885,9 +3886,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3885 */ 3886 */
3886 iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); 3887 iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
3887 3888
3888 iwl_hw_detect(priv); 3889 hw_rev = iwl_hw_detect(priv);
3889 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 3890 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
3890 priv->cfg->name, priv->hw_rev); 3891 priv->cfg->name, hw_rev);
3891 3892
3892 /* We disable the RETRY_TIMEOUT register (0x41) to keep 3893 /* We disable the RETRY_TIMEOUT register (0x41) to keep
3893 * PCI Tx retries from interfering with C3 CPU state */ 3894 * PCI Tx retries from interfering with C3 CPU state */
@@ -3903,7 +3904,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3903 * 4. Read EEPROM 3904 * 4. Read EEPROM
3904 *****************/ 3905 *****************/
3905 /* Read the EEPROM */ 3906 /* Read the EEPROM */
3906 err = iwl_eeprom_init(priv); 3907 err = iwl_eeprom_init(priv, hw_rev);
3907 if (err) { 3908 if (err) {
3908 IWL_ERR(priv, "Unable to init EEPROM\n"); 3909 IWL_ERR(priv, "Unable to init EEPROM\n");
3909 goto out_iounmap; 3910 goto out_iounmap;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 2c2d5b00a345..1779d603e3e6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1253,7 +1253,6 @@ struct iwl_priv {
1253 1253
1254 /* pci hardware address support */ 1254 /* pci hardware address support */
1255 void __iomem *hw_base; 1255 void __iomem *hw_base;
1256 u32 hw_rev;
1257 u8 rev_id; 1256 u8 rev_id;
1258 1257
1259 /* microcode/device supports multiple contexts */ 1258 /* microcode/device supports multiple contexts */
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index f70d87162e59..4f8c13e9850b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -188,13 +188,13 @@ static void iwl_set_otp_access(struct iwl_priv *priv, enum iwl_access_mode mode)
188 CSR_OTP_GP_REG_OTP_ACCESS_MODE); 188 CSR_OTP_GP_REG_OTP_ACCESS_MODE);
189} 189}
190 190
191static int iwlcore_get_nvm_type(struct iwl_priv *priv) 191static int iwlcore_get_nvm_type(struct iwl_priv *priv, u32 hw_rev)
192{ 192{
193 u32 otpgp; 193 u32 otpgp;
194 int nvm_type; 194 int nvm_type;
195 195
196 /* OTP only valid for CP/PP and after */ 196 /* OTP only valid for CP/PP and after */
197 switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { 197 switch (hw_rev & CSR_HW_REV_TYPE_MSK) {
198 case CSR_HW_REV_TYPE_NONE: 198 case CSR_HW_REV_TYPE_NONE:
199 IWL_ERR(priv, "Unknown hardware type\n"); 199 IWL_ERR(priv, "Unknown hardware type\n");
200 return -ENOENT; 200 return -ENOENT;
@@ -394,7 +394,7 @@ u16 iwl_eeprom_query16(const struct iwl_priv *priv, size_t offset)
394 * 394 *
395 * NOTE: This routine uses the non-debug IO access functions. 395 * NOTE: This routine uses the non-debug IO access functions.
396 */ 396 */
397int iwl_eeprom_init(struct iwl_priv *priv) 397int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
398{ 398{
399 __le16 *e; 399 __le16 *e;
400 u32 gp = iwl_read32(priv, CSR_EEPROM_GP); 400 u32 gp = iwl_read32(priv, CSR_EEPROM_GP);
@@ -404,7 +404,7 @@ int iwl_eeprom_init(struct iwl_priv *priv)
404 u16 validblockaddr = 0; 404 u16 validblockaddr = 0;
405 u16 cache_addr = 0; 405 u16 cache_addr = 0;
406 406
407 priv->nvm_device_type = iwlcore_get_nvm_type(priv); 407 priv->nvm_device_type = iwlcore_get_nvm_type(priv, hw_rev);
408 if (priv->nvm_device_type == -ENOENT) 408 if (priv->nvm_device_type == -ENOENT)
409 return -ENOENT; 409 return -ENOENT;
410 /* allocate eeprom */ 410 /* allocate eeprom */
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
index 35bf54b38515..6b4343bd4bd2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
@@ -302,7 +302,7 @@ struct iwl_eeprom_ops {
302}; 302};
303 303
304 304
305int iwl_eeprom_init(struct iwl_priv *priv); 305int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev);
306void iwl_eeprom_free(struct iwl_priv *priv); 306void iwl_eeprom_free(struct iwl_priv *priv);
307int iwl_eeprom_check_version(struct iwl_priv *priv); 307int iwl_eeprom_check_version(struct iwl_priv *priv);
308int iwl_eeprom_check_sku(struct iwl_priv *priv); 308int iwl_eeprom_check_sku(struct iwl_priv *priv);