All of lore.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Reinette Chatre <reinette.chatre@intel.com>,
	stable@kernel.org
Subject: [PATCH 2/6 2.6.31 and w-t] iwlwifi: only show active power level via sysfs
Date: Thu,  9 Jul 2009 10:33:37 -0700	[thread overview]
Message-ID: <1247160821-14989-3-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1247160821-14989-2-git-send-email-reinette.chatre@intel.com>

From: Reinette Chatre <reinette.chatre@intel.com>

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
---
Needed in 2.6.31 and 2.6.30 because without it powertop
is not able to parse the power level correctly.

Applies to both wireless-testing and 2.6.31, but not to 2.6.30.

Backporting will be done at the time this patch becomes available in
2.6.31. Will resend to stable@kernel.org at that time. Now just adding
stable@kernel.org as cc to bring patch to your attention.

 drivers/net/wireless/iwlwifi/iwl-agn.c      |    4 +---
 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 13279b1..ad50022 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2617,12 +2617,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;
 }
 
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 303c4b4..7ff95f8 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3573,12 +3573,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;
 }
 
-- 
1.5.6.3


  reply	other threads:[~2009-07-09 17:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09 17:33 [PATCH 0/6] iwlwifi driver updates 07/09/2009 Reinette Chatre
2009-07-09 17:33 ` [PATCH 1/6] iwlwifi: move show_qos to debugfs Reinette Chatre
2009-07-09 17:33   ` Reinette Chatre [this message]
2009-07-09 17:33     ` [PATCH 3/6] iwlwifi: fix permissions on debugfs files Reinette Chatre
2009-07-09 17:33       ` [PATCH 4/6 2.6.31 and w-t] iwlwifi: only update byte count table during aggregation Reinette Chatre
2009-07-09 17:33         ` [PATCH 5/6] iwl3945: cleanup number of queues settings Reinette Chatre
2009-07-09 17:33           ` [PATCH 6/6] iwlagn: fix minimum number of queues setting Reinette Chatre
2009-07-09 19:49     ` [PATCH 2/6 2.6.31 and w-t] iwlwifi: only show active power level via sysfs Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1247160821-14989-3-git-send-email-reinette.chatre@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.