Skip to content

Commit

Permalink
iwlwifi: only show active power level via sysfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Reinette Chatre authored and John W. Linville committed Jul 21, 2009
1 parent 513a239 commit 872ed19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2675,12 +2675,10 @@ static ssize_t show_power_level(struct device *d,
struct device_attribute *attr, char *buf)
{
struct iwl_priv *priv = dev_get_drvdata(d);
int mode = priv->power_data.user_power_setting;
int level = priv->power_data.power_mode;
char *p = buf;

p += sprintf(p, "INDEX:%d\t", level);
p += sprintf(p, "USER:%d\n", mode);
p += sprintf(p, "%d\n", level);
return p - buf + 1;
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -3643,12 +3643,10 @@ static ssize_t show_power_level(struct device *d,
struct device_attribute *attr, char *buf)
{
struct iwl_priv *priv = dev_get_drvdata(d);
int mode = priv->power_data.user_power_setting;
int level = priv->power_data.power_mode;
char *p = buf;

p += sprintf(p, "INDEX:%d\t", level);
p += sprintf(p, "USER:%d\n", mode);
p += sprintf(p, "%d\n", level);
return p - buf + 1;
}

Expand Down

0 comments on commit 872ed19

Please sign in to comment.