Re: [PATCH 2/2] leds:arch/sh/boards/landisk LEDs supports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2007-05-09 at 22:45 +0900, kogiidena wrote:
> > On Wed, 2007-05-09 at 20:42 +0900, kogiidena wrote:
> >> >As far as I can tell, the existing timer trigger can do everything the
> >> >blink trigger can (and more besides).
> >> I want to blink LED in the initial state.
> >
> > Are you after to set that per LED or would some standard configurable
> > default for all LEDs work?
> I'm sorry.The meaning of the question cannot be understood.
> My LED is use in the following.
> I want to blink LED while booting it.
> When boot ends, LED is turned on.

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?

> > 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.

Regards,

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux