From: Johannes Berg <johannes@sipsolutions.net>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: Pavel Machek <pavel@ucw.cz>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
John Lenz <lenz@cs.wisc.edu>,
Richard Purdie <rpurdie@openedhand.com>
Subject: Re: led_class: storing a value can act but return -EINVAL
Date: Sun, 30 Apr 2006 14:05:11 +0200 [thread overview]
Message-ID: <1146398711.17814.15.camel@localhost> (raw)
In-Reply-To: <1146398270.6254.9.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]
On Sun, 2006-04-30 at 12:57 +0100, Richard Purdie wrote:
> echo 255> brightness works, returns success.
??
For me (bash) that doesn't do anything useful.
Were you looking for "echo -n 255 > brightness"?
> echo 255 > brightness works but then returns -EINVAL.
> So we currently do b, quite strictly. Its the trailing space thats the
> problem. It also shouldn't have altered the brightness value if it ends
> up returning -EINVAL.
Yes, but you do change the actual value, which IMHO you shouldn't when
it will return -EINVAL. I should have said
b) reject anything that isn't *only* a number and take no action
instead.
> I've looked around other implementations and it would appear we should
> accept an optional space. Most sysfs attributes seem to handle this
> differently, each with its own "bugs".
Yeah, unfortunately that is true. Maybe there should've been helper
functions like when you have a sysfs-int attribute that is set directly
without get/set calls. I'd suggest looking at that code.
> I've some fixes in mind both for the led and backlight classes which
> I'll post once I've done a little more testing. I'd be interested to
> know the official view on what the attributes should/shouldn't accept
> is.
I have a question about the backlight class: I'm writing a patch
currently to control the *keyboard* backlight on powerbooks, is that
appropriate for the backlight class (setting the fbdev callback to
reject everything)?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
next prev parent reply other threads:[~2006-04-30 12:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-29 11:33 led_class: storing a value can act but return -EINVAL Johannes Berg
2006-04-30 10:02 ` Pavel Machek
2006-04-30 11:01 ` Johannes Berg
2006-04-30 11:57 ` Richard Purdie
2006-04-30 12:05 ` Johannes Berg [this message]
2006-04-30 12:10 ` Pavel Machek
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=1146398711.17814.15.camel@localhost \
--to=johannes@sipsolutions.net \
--cc=lenz@cs.wisc.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rpurdie@openedhand.com \
--cc=rpurdie@rpsys.net \
/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.