lkml.org 
[lkml]   [2006]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: led_class: storing a value can act but return -EINVAL
Hi!

> When I store something into the brightness sysfs attribute of an LED, it
> will accept the value but return -EINVAL:
>
> johannes:/sys/class/leds/pmu-front-led# echo 255 > brightness
> bash: echo: write error: Invalid argument
>
> (yet the LED turns on)
>
> This happens because the store callback doesn't consume all the input.

Well, I'd argue current behaviour is okay... can you strace it? It
should accept the number (return 3) then return -EINVAL.

> There are two possible ways to handle this:
> a) accept anything that begins with a valid number.
> b) reject anything that isn't *only* a number

c) accept anything that is number, ignore newlines.

a) is just way too ugly...
Pavel

--
Thanks, Sharp!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-30 12:23    [W:0.031 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site