提交 872ed190 编写于 作者: R Reinette Chatre 提交者: John W. Linville

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: NReinette Chatre <reinette.chatre@intel.com>
cc: stable@kernel.org
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 513a2396
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册