diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2009-07-09 13:33:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-21 12:07:31 -0400 |
commit | 872ed1902f511a8947021c562f5728a5bf0640b5 (patch) | |
tree | 1acc79a5c3340204be08d5483c04a698a3a335eb | |
parent | 513a2396d8e8327aff1ce50bea3fb4f16ff3455b (diff) |
iwlwifi: only show active power level via sysfs
This changes the power_level file to adhere to the "one value
per file" sysfs rule. The user will know which power level was
requested as it will be the number just written to this file. It
is thus not necessary to create a new sysfs file for this value.
In addition it fixes a problem where powertop's parsing expects
this value to be the first value in this file without any descriptions.
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 6d1519e1f011..355f50ea7fef 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2675,12 +2675,10 @@ static ssize_t show_power_level(struct device *d, | |||
2675 | struct device_attribute *attr, char *buf) | 2675 | struct device_attribute *attr, char *buf) |
2676 | { | 2676 | { |
2677 | struct iwl_priv *priv = dev_get_drvdata(d); | 2677 | struct iwl_priv *priv = dev_get_drvdata(d); |
2678 | int mode = priv->power_data.user_power_setting; | ||
2679 | int level = priv->power_data.power_mode; | 2678 | int level = priv->power_data.power_mode; |
2680 | char *p = buf; | 2679 | char *p = buf; |
2681 | 2680 | ||
2682 | p += sprintf(p, "INDEX:%d\t", level); | 2681 | p += sprintf(p, "%d\n", level); |
2683 | p += sprintf(p, "USER:%d\n", mode); | ||
2684 | return p - buf + 1; | 2682 | return p - buf + 1; |
2685 | } | 2683 | } |
2686 | 2684 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index cb9bd4c8f25e..956798f2c80c 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3643,12 +3643,10 @@ static ssize_t show_power_level(struct device *d, | |||
3643 | struct device_attribute *attr, char *buf) | 3643 | struct device_attribute *attr, char *buf) |
3644 | { | 3644 | { |
3645 | struct iwl_priv *priv = dev_get_drvdata(d); | 3645 | struct iwl_priv *priv = dev_get_drvdata(d); |
3646 | int mode = priv->power_data.user_power_setting; | ||
3647 | int level = priv->power_data.power_mode; | 3646 | int level = priv->power_data.power_mode; |
3648 | char *p = buf; | 3647 | char *p = buf; |
3649 | 3648 | ||
3650 | p += sprintf(p, "INDEX:%d\t", level); | 3649 | p += sprintf(p, "%d\n", level); |
3651 | p += sprintf(p, "USER:%d\n", mode); | ||
3652 | return p - buf + 1; | 3650 | return p - buf + 1; |
3653 | } | 3651 | } |
3654 | 3652 | ||