diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-21 11:54:49 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-21 11:54:49 -0800 |
commit | ed4b2019a62e2208a8370461dd91ed4de2c9fc8f (patch) | |
tree | 2910816b23718e9cebd20be9eae2b6876edd849b /drivers/net/wireless/iwlwifi/iwl-5000-hw.h | |
parent | b74665606962456af7f92b1e448cee30ce70967b (diff) | |
parent | 92c6f8d849178582fc527aaf1e51dd37a74767d3 (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.h | 14 |
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 */ |