iwlwifi: only show active power level via sysfs
authorReinette Chatre <reinette.chatre@intel.com>
Thu, 9 Jul 2009 17:33:37 +0000 (10:33 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 21 Jul 2009 16:07:31 +0000 (12:07 -0400)
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>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index 6d1519e..355f50e 100644 (file)
@@ -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;
 }
 
index cb9bd4c..956798f 100644 (file)
@@ -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;
 }