* [PATCH] power_supply: Remove capacity_level from list of sysfs attributes @ 2008-02-05 16:13 Thadeu Lima de Souza Cascardo 2008-02-06 8:53 ` Andrew Morton 0 siblings, 1 reply; 6+ messages in thread From: Thadeu Lima de Souza Cascardo @ 2008-02-05 16:13 UTC (permalink / raw) To: dwmw2; +Cc: linux-kernel --- drivers/power/power_supply_sysfs.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index d482484..13399d1 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -106,7 +106,6 @@ static struct device_attribute power_supply_attrs[] = { POWER_SUPPLY_ATTR(energy_now), POWER_SUPPLY_ATTR(energy_avg), POWER_SUPPLY_ATTR(capacity), - POWER_SUPPLY_ATTR(capacity_level), POWER_SUPPLY_ATTR(temp), POWER_SUPPLY_ATTR(temp_ambient), POWER_SUPPLY_ATTR(time_to_empty_now), -- 1.5.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] power_supply: Remove capacity_level from list of sysfs attributes 2008-02-05 16:13 [PATCH] power_supply: Remove capacity_level from list of sysfs attributes Thadeu Lima de Souza Cascardo @ 2008-02-06 8:53 ` Andrew Morton 2008-02-06 10:50 ` Thadeu Lima de Souza Cascardo 0 siblings, 1 reply; 6+ messages in thread From: Andrew Morton @ 2008-02-06 8:53 UTC (permalink / raw) To: Thadeu Lima de Souza Cascardo; +Cc: dwmw2, linux-kernel On Tue, 5 Feb 2008 14:13:36 -0200 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > --- > drivers/power/power_supply_sysfs.c | 1 - > 1 files changed, 0 insertions(+), 1 deletions(-) > > diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c > index d482484..13399d1 100644 > --- a/drivers/power/power_supply_sysfs.c > +++ b/drivers/power/power_supply_sysfs.c > @@ -106,7 +106,6 @@ static struct device_attribute power_supply_attrs[] = { > POWER_SUPPLY_ATTR(energy_now), > POWER_SUPPLY_ATTR(energy_avg), > POWER_SUPPLY_ATTR(capacity), > - POWER_SUPPLY_ATTR(capacity_level), > POWER_SUPPLY_ATTR(temp), > POWER_SUPPLY_ATTR(temp_ambient), > POWER_SUPPLY_ATTR(time_to_empty_now), What is the reason for making this change? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power_supply: Remove capacity_level from list of sysfs attributes 2008-02-06 8:53 ` Andrew Morton @ 2008-02-06 10:50 ` Thadeu Lima de Souza Cascardo 2008-02-06 21:56 ` Andrew Morton 0 siblings, 1 reply; 6+ messages in thread From: Thadeu Lima de Souza Cascardo @ 2008-02-06 10:50 UTC (permalink / raw) To: linux-kernel; +Cc: dwmw2 On Wed, Feb 06, 2008 at 12:53:12AM -0800, Andrew Morton wrote: > On Tue, 5 Feb 2008 14:13:36 -0200 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > > > --- > > drivers/power/power_supply_sysfs.c | 1 - > > 1 files changed, 0 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c > > index d482484..13399d1 100644 > > --- a/drivers/power/power_supply_sysfs.c > > +++ b/drivers/power/power_supply_sysfs.c > > @@ -106,7 +106,6 @@ static struct device_attribute power_supply_attrs[] = { > > POWER_SUPPLY_ATTR(energy_now), > > POWER_SUPPLY_ATTR(energy_avg), > > POWER_SUPPLY_ATTR(capacity), > > - POWER_SUPPLY_ATTR(capacity_level), > > POWER_SUPPLY_ATTR(temp), > > POWER_SUPPLY_ATTR(temp_ambient), > > POWER_SUPPLY_ATTR(time_to_empty_now), > > What is the reason for making this change? Sorry. The following commit is the reason for this patch. It removes CAPACITY_LEVEL from every other code, leaving the array with sysfs attributes with one more entry than the number of enums in power_supply.h. This leads to some attributes containing the value of the attribute right after it. For example, temp_ambient would have the value of time_to_empty_now. In my case, I had time_to_full_avg have the value which should be in model_name, when the former was usually empty. commit 8efe444038a205e79b38b7ad03878824901849a8 Author: Andres Salomon <dilinger@queued.net> Date: Wed Dec 12 14:12:56 2007 -0500 power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL The CAPACITY_LEVEL stuff defines various levels of charge; however, what is the difference between them? What differentiates between HIGH and NORMAL LOW and CRITICAL, etc? As it appears that these are fairly arbitrary, we end up making such policy decisions in the kernel (or in hardware). This is the sort of decision that should be made in userspace, not in the kernel. If the hardware does not support _CAPACITY and it cannot be easily calculate then perhaps the driver should register a custom CAPACITY_LEVEL attribute; however, userspace should not become accustomed to looking for such a thing, and we should certainly not encourage drivers to provide CAPACITY_LEVEL stubs. The following removes support for POWER_SUPPLY_PROP_CAPACITY_LEVEL. The OLPC battery driver is the only driver making use of this, so it's removed from there as well. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power_supply: Remove capacity_level from list of sysfs attributes 2008-02-06 10:50 ` Thadeu Lima de Souza Cascardo @ 2008-02-06 21:56 ` Andrew Morton 2008-02-07 0:02 ` Anton Vorontsov 0 siblings, 1 reply; 6+ messages in thread From: Andrew Morton @ 2008-02-06 21:56 UTC (permalink / raw) To: Thadeu Lima de Souza Cascardo; +Cc: linux-kernel, dwmw2, Andres Salomon On Wed, 6 Feb 2008 08:50:18 -0200 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > On Wed, Feb 06, 2008 at 12:53:12AM -0800, Andrew Morton wrote: > > On Tue, 5 Feb 2008 14:13:36 -0200 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > > > > > --- > > > drivers/power/power_supply_sysfs.c | 1 - > > > 1 files changed, 0 insertions(+), 1 deletions(-) > > > > > > diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c > > > index d482484..13399d1 100644 > > > --- a/drivers/power/power_supply_sysfs.c > > > +++ b/drivers/power/power_supply_sysfs.c > > > @@ -106,7 +106,6 @@ static struct device_attribute power_supply_attrs[] = { > > > POWER_SUPPLY_ATTR(energy_now), > > > POWER_SUPPLY_ATTR(energy_avg), > > > POWER_SUPPLY_ATTR(capacity), > > > - POWER_SUPPLY_ATTR(capacity_level), > > > POWER_SUPPLY_ATTR(temp), > > > POWER_SUPPLY_ATTR(temp_ambient), > > > POWER_SUPPLY_ATTR(time_to_empty_now), > > > > What is the reason for making this change? > > Sorry. The following commit is the reason for this patch. > > It removes CAPACITY_LEVEL from every other code, leaving the array with > sysfs attributes with one more entry than the number of enums in > power_supply.h. This leads to some attributes containing the value of > the attribute right after it. For example, temp_ambient would have the > value of time_to_empty_now. In my case, I had time_to_full_avg have the > value which should be in model_name, when the former was usually empty. > OK, thanks, I think I have enough material there to put together the final patch. Next time, please do cc the author of the change which you're fixing. And please do reply-to-all when working with kernel people, thanks. I tagged this fix as needed-in-2.6.24.x as well. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power_supply: Remove capacity_level from list of sysfs attributes 2008-02-06 21:56 ` Andrew Morton @ 2008-02-07 0:02 ` Anton Vorontsov 2008-02-07 0:36 ` Andrew Morton 0 siblings, 1 reply; 6+ messages in thread From: Anton Vorontsov @ 2008-02-07 0:02 UTC (permalink / raw) To: Andrew Morton Cc: Thadeu Lima de Souza Cascardo, linux-kernel, dwmw2, Andres Salomon On Wed, Feb 06, 2008 at 01:56:04PM -0800, Andrew Morton wrote: > On Wed, 6 Feb 2008 08:50:18 -0200 > Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > > > On Wed, Feb 06, 2008 at 12:53:12AM -0800, Andrew Morton wrote: > > > On Tue, 5 Feb 2008 14:13:36 -0200 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > > > > > > > --- > > > > drivers/power/power_supply_sysfs.c | 1 - > > > > 1 files changed, 0 insertions(+), 1 deletions(-) > > > > > > > > diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c > > > > index d482484..13399d1 100644 > > > > --- a/drivers/power/power_supply_sysfs.c > > > > +++ b/drivers/power/power_supply_sysfs.c > > > > @@ -106,7 +106,6 @@ static struct device_attribute power_supply_attrs[] = { > > > > POWER_SUPPLY_ATTR(energy_now), > > > > POWER_SUPPLY_ATTR(energy_avg), > > > > POWER_SUPPLY_ATTR(capacity), > > > > - POWER_SUPPLY_ATTR(capacity_level), > > > > POWER_SUPPLY_ATTR(temp), > > > > POWER_SUPPLY_ATTR(temp_ambient), > > > > POWER_SUPPLY_ATTR(time_to_empty_now), > > > > > > What is the reason for making this change? > > > > Sorry. The following commit is the reason for this patch. > > > > It removes CAPACITY_LEVEL from every other code, leaving the array with > > sysfs attributes with one more entry than the number of enums in > > power_supply.h. This leads to some attributes containing the value of > > the attribute right after it. For example, temp_ambient would have the > > value of time_to_empty_now. In my case, I had time_to_full_avg have the > > value which should be in model_name, when the former was usually empty. > > > > OK, thanks, I think I have enough material there to put together the final > patch. > > Next time, please do cc the author of the change which you're fixing. And > please do reply-to-all when working with kernel people, thanks. > > I tagged this fix as needed-in-2.6.24.x as well. Nope, I don't think 2.6.24.x needs this fix. Commit 8efe444038a205e79b, wasn't been in 2.6.24. Only 2.6.25-rc0 affected. If applied to 2.6.24.x, it will break things. Thanks, -- Anton Vorontsov email: cbou@mail.ru backup email: ya-cbou@yandex.ru irc://irc.freenode.net/bd2 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] power_supply: Remove capacity_level from list of sysfs attributes 2008-02-07 0:02 ` Anton Vorontsov @ 2008-02-07 0:36 ` Andrew Morton 0 siblings, 0 replies; 6+ messages in thread From: Andrew Morton @ 2008-02-07 0:36 UTC (permalink / raw) To: cbouatmailru; +Cc: cascardo, linux-kernel, dwmw2, dilinger On Thu, 7 Feb 2008 03:02:06 +0300 Anton Vorontsov <cbouatmailru@gmail.com> wrote: > On Wed, Feb 06, 2008 at 01:56:04PM -0800, Andrew Morton wrote: > > On Wed, 6 Feb 2008 08:50:18 -0200 > > Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > > > > > On Wed, Feb 06, 2008 at 12:53:12AM -0800, Andrew Morton wrote: > > > > On Tue, 5 Feb 2008 14:13:36 -0200 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org> wrote: > > > > > > > > > --- > > > > > drivers/power/power_supply_sysfs.c | 1 - > > > > > 1 files changed, 0 insertions(+), 1 deletions(-) > > > > > > > > > > diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c > > > > > index d482484..13399d1 100644 > > > > > --- a/drivers/power/power_supply_sysfs.c > > > > > +++ b/drivers/power/power_supply_sysfs.c > > > > > @@ -106,7 +106,6 @@ static struct device_attribute power_supply_attrs[] = { > > > > > POWER_SUPPLY_ATTR(energy_now), > > > > > POWER_SUPPLY_ATTR(energy_avg), > > > > > POWER_SUPPLY_ATTR(capacity), > > > > > - POWER_SUPPLY_ATTR(capacity_level), > > > > > POWER_SUPPLY_ATTR(temp), > > > > > POWER_SUPPLY_ATTR(temp_ambient), > > > > > POWER_SUPPLY_ATTR(time_to_empty_now), > > > > > > > > What is the reason for making this change? > > > > > > Sorry. The following commit is the reason for this patch. > > > > > > It removes CAPACITY_LEVEL from every other code, leaving the array with > > > sysfs attributes with one more entry than the number of enums in > > > power_supply.h. This leads to some attributes containing the value of > > > the attribute right after it. For example, temp_ambient would have the > > > value of time_to_empty_now. In my case, I had time_to_full_avg have the > > > value which should be in model_name, when the former was usually empty. > > > > > > > OK, thanks, I think I have enough material there to put together the final > > patch. > > > > Next time, please do cc the author of the change which you're fixing. And > > please do reply-to-all when working with kernel people, thanks. > > > > I tagged this fix as needed-in-2.6.24.x as well. > > Nope, I don't think 2.6.24.x needs this fix. Commit 8efe444038a205e79b, > wasn't been in 2.6.24. Only 2.6.25-rc0 affected. > > If applied to 2.6.24.x, it will break things. > ah, OK, thanks. git timestamps considered harmful. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-02-07 0:49 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-02-05 16:13 [PATCH] power_supply: Remove capacity_level from list of sysfs attributes Thadeu Lima de Souza Cascardo 2008-02-06 8:53 ` Andrew Morton 2008-02-06 10:50 ` Thadeu Lima de Souza Cascardo 2008-02-06 21:56 ` Andrew Morton 2008-02-07 0:02 ` Anton Vorontsov 2008-02-07 0:36 ` Andrew Morton
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox