summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-21 11:54:49 -0800
committerDavid S. Miller <davem@davemloft.net>2009-12-21 11:54:49 -0800
commited4b2019a62e2208a8370461dd91ed4de2c9fc8f (patch)
tree2910816b23718e9cebd20be9eae2b6876edd849b /drivers/net/wireless/iwlwifi/iwl-5000-hw.h
parentb74665606962456af7f92b1e448cee30ce70967b (diff)
parent92c6f8d849178582fc527aaf1e51dd37a74767d3 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000-hw.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000-hw.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
index 4ef6804a455a..bc056e9ab85f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-5000-hw.h
@@ -92,11 +92,15 @@
static inline s32 iwl_temp_calib_to_offset(struct iwl_priv *priv)
{
- u16 *temp_calib = (u16 *)iwl_eeprom_query_addr(priv,
- EEPROM_5000_TEMPERATURE);
- /* offset = temperature - voltage / coef */
- s32 offset = (s32)(temp_calib[0] - temp_calib[1] / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF);
- return offset;
+ u16 temperature, voltage;
+ __le16 *temp_calib =
+ (__le16 *)iwl_eeprom_query_addr(priv, EEPROM_5000_TEMPERATURE);
+
+ temperature = le16_to_cpu(temp_calib[0]);
+ voltage = le16_to_cpu(temp_calib[1]);
+
+ /* offset = temp - volt / coeff */
+ return (s32)(temperature - voltage / IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF);
}
/* Fixed (non-configurable) rx data from phy */