diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2010-03-11 13:58:47 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 15:58:53 -0700 |
commit | 78164a9748e276563ec008ed916720d8a90db86b (patch) | |
tree | 24bce955e0daa304174482aa88985db6da137b72 /net/lapb/lapb_iface.c | |
parent | 8900170d176e29c905d959e515b502debc58219c (diff) |
leds-gpio: fix default state handling on OF platforms
commit 0493a4ff10959ff4c8e0d65efee25b7ffd4fa5db upstream.
The driver wrongly sets default state for LEDs that don't specify
default-state property.
Currently the driver handles default state this way:
memset(&led, 0, sizeof(led));
for_each_child_of_node(np, child) {
state = of_get_property(child, "default-state", NULL);
if (state) {
if (!strcmp(state, "keep"))
led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
...
}
ret = create_gpio_led(&led, ...);
}
Which means that all LEDs that do not specify default-state will inherit
the last value of the default-state property, which is wrong.
This patch fixes the issue by moving LED's template initialization into
the loop body.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions