From: "kogiidena" <kogiidena@eggplant.ddo.jp>
To: "Richard Purdie" <rpurdie@rpsys.net>
Cc: linux-kernel@vger.kernel.org, lethal@linux-sh.org
Subject: Re: [PATCH 2/2] leds:arch/sh/boards/landisk LEDs supports
Date: Thu, 10 May 2007 07:18:45 +0900 (JST) [thread overview]
Message-ID: <1445.192.168.1.10.1178749125.squirrel@eggplant.ddo.jp> (raw)
In-Reply-To: <1178723184.6291.16.camel@localhost.localdomain>
> Your device has more than one LED. Do you need to be able to configure
> each LED individually or can they all have the same default settings?
Yes. It need to be able to configure each LED individually as following.
this patch supports different two hardware.
LANDISK:
LANDISK have two LED.
power-led = blink.
status-led = hard.
USL-5P:
USK-5P have 7 LED and one BUZZER.
power-led = blink.
status-led = blink.
led1 = none.
led2 = none.
led3 = none.
led4 = none.
led5 = none.
buzzer = bitshift.
>> > The approach is probably a good idea but you'll have to split struct
>> > timer_list timer from the data structure.
>
> "struct timer_list timer" in "struct timer_trig_data" is unused when its
> used for a default_trigger_data which is wasted space.
>
>> > Also, if default_trigger wasn't the timer trigger you have a nice oops
>> > waiting to happen.
>> I'm sorry that it is not possible to understand enough.
>> Please teach concretely.
>
> You don't check default_trigger == "timer" before using
> default_trigger_data.
>
> Imagine we have:
>
> struct led_classdev landisk_leds = {
> .name = "power",
> .default_trigger = "bitshift",
> .default_trigger_data =&default_bitshift_trig_data,
> };
>
> where:
>
> struct bitshift_trig_data {
> unsigned long single_variable;
> };
>
> If you then:
>
> echo "timer" > /sys/class/leds/power/trigger
>
> your patch will use random data and possibly oops.
Thank you for explaining.
I understood the problem.
However, a complete solution is not hit on.
I think that it is the easiest solution to define the new trigger "Blink", and to use it.
kogiidena
next prev parent reply other threads:[~2007-05-09 22:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-08 12:27 kogiidena
2007-05-08 12:46 ` Richard Purdie
2007-05-09 11:42 ` kogiidena
2007-05-09 12:14 ` Richard Purdie
2007-05-09 13:45 ` kogiidena
2007-05-09 15:06 ` Richard Purdie
2007-05-09 22:18 ` kogiidena [this message]
2007-05-11 15:02 ` kogiidena
2007-05-12 4:01 ` kogiidena
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=1445.192.168.1.10.1178749125.squirrel@eggplant.ddo.jp \
--to=kogiidena@eggplant.ddo.jp \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®