From: Anton Vorontsov <cbou@mail.ru>
To: Greg KH <greg@kroah.com>
Cc: linux-kernel@vger.kernel.org, kernel-discuss@handhelds.org,
dwmw2@infradead.org
Subject: Re: [PATCH 3/7] [RFC] Battery monitoring class
Date: Thu, 12 Apr 2007 17:43:54 +0400 [thread overview]
Message-ID: <20070412134354.GA25461@zarina> (raw)
In-Reply-To: <20070412034323.GA7017@kroah.com>
Hello Greg,
On Wed, Apr 11, 2007 at 08:43:23PM -0700, Greg KH wrote:
> On Thu, Apr 12, 2007 at 03:25:03AM +0400, Anton Vorontsov wrote:
> > Here is battery monitor class. According to first copyright string, we're
> > maintaining it since 2003. I've took few days and cleaned it up to be
> > more suitable for mainline inclusion.
> >
> > It differs from battery class at git://git.infradead.org/battery-2.6.git:
>
> Why fork from David's work? Does he not like these changes for some
> reason?
It's not a fork, actually. Ian Molton started battery stuff years before
David's work.
Though ours and David's exported API functions are exactly the same
(don't count functions which are unique for our code), but our
implementation a little intersects with David's.
For me it was no matter if I'll take handhelds.org or David's code as a
start point, except that hh.o code familiar to me, and I can test it on
real devices.
Though, you're right, we're in situation when we've two battery classes
now. :-/ And another pity fact is that we also have 8 Mb of patches in
our CVS. It takes a lot of time to to cleanup code for mainline,
especially with limited man-power resources. But we're working hard.
So, this is brief explanation why it took so long for us to show up.
> > +static int battery_create_attrs(struct battery *bat)
> > +{
> > + int rc;
> > +
> > + #define create_bat_attr_conditional(name) \
> > + if(bat->get_##name) { \
> > + rc = device_create_file(bat->dev, &dev_attr_##name); \
> > + if (rc) goto name##_failed; \
> > + }
> > +
> > + create_bat_attr_conditional(status);
> > + create_bat_attr_conditional(min_voltage);
> > + create_bat_attr_conditional(min_current);
> > + create_bat_attr_conditional(min_capacity);
> > + create_bat_attr_conditional(max_voltage);
> > + create_bat_attr_conditional(max_current);
> > + create_bat_attr_conditional(max_capacity);
> > + create_bat_attr_conditional(temp);
> > + create_bat_attr_conditional(voltage);
> > + create_bat_attr_conditional(current);
> > + create_bat_attr_conditional(capacity);
>
> Use an attribute group please. It's much simpler and will be created at
> the proper time so your userspace tools don't have to sit and spin in
> order to properly wait for them to show up.
>
> Ok, yes, you want a conditional type of attribute group, like the
> new firewire code does. I have no problem adding that if you like.
I'm not sure if it's possible to create that type of conditional
attribute group. Because the condition is "bat->func != NULL", not
attribute' function. And that condition is battery-specific, not class
specific.
But anyway, I guess you're talking about not yet existent API, so I'd be
glad to take a look.
> thanks,
>
> greg k-h
Thanks for comments!
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.org/bd2
next prev parent reply other threads:[~2007-04-12 13:47 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 23:25 [PATCH 3/7] [RFC] Battery monitoring class Anton Vorontsov
2007-04-12 2:53 ` Randy Dunlap
2007-04-12 16:51 ` Anton Vorontsov
2007-04-12 3:43 ` Greg KH
2007-04-12 12:25 ` Henrique de Moraes Holschuh
2007-04-12 13:43 ` Anton Vorontsov [this message]
2007-04-12 13:08 ` Matthew Garrett
2007-04-12 14:15 ` Anton Vorontsov
2007-04-12 14:24 ` Matthew Garrett
2007-04-12 14:36 ` [Kernel-discuss] " Paul Sokolovsky
2007-04-12 18:56 ` Henrique de Moraes Holschuh
2007-04-12 20:44 ` Anton Vorontsov
2007-04-13 0:51 ` Henrique de Moraes Holschuh
2007-04-13 2:15 ` Anton Vorontsov
2007-04-24 19:36 ` Pavel Machek
2007-04-13 2:34 ` Shem Multinymous
2007-04-13 2:36 ` Anton Vorontsov
2007-04-13 13:51 ` Henrique de Moraes Holschuh
2007-04-12 15:00 ` Shem Multinymous
2007-04-12 15:18 ` Anton Vorontsov
2007-04-12 17:23 ` Shem Multinymous
2007-04-13 13:49 ` Anton Vorontsov
2007-04-15 0:43 ` Anton Vorontsov
2007-05-04 9:59 ` Pavel Machek
2007-04-15 19:56 ` Pavel Machek
2007-04-15 22:10 ` [Kernel-discuss] " Anton Vorontsov
2007-04-15 22:08 ` Ondrej Zajicek
2007-04-15 22:50 ` Anton Vorontsov
2007-04-16 0:57 ` Henrique de Moraes Holschuh
2007-04-16 1:57 ` Anton Vorontsov
2007-04-16 14:34 ` Henrique de Moraes Holschuh
2007-04-16 2:32 ` [Kernel-discuss] " ian
2007-04-16 3:12 ` Anton Vorontsov
2007-04-16 8:28 ` ian
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=20070412134354.GA25461@zarina \
--to=cbou@mail.ru \
--cc=dwmw2@infradead.org \
--cc=greg@kroah.com \
--cc=kernel-discuss@handhelds.org \
--cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox