]> git.baikalelectronics.ru Git - kernel.git/commit
leds-gpio: of: led should not be created if its status is disabled
authorJosh Wu <josh.wu@atmel.com>
Thu, 26 Sep 2013 11:27:56 +0000 (04:27 -0700)
committerBryan Wu <cooloney@gmail.com>
Fri, 25 Oct 2013 17:12:55 +0000 (10:12 -0700)
commit0e198c7d04aaa37fb1eeb43901d8efd56a5afa26
tree1562001a1f0f5c289b4e841330731f9583d62982
parent13ada15b8d26b2b66609053d1738e8f613411dc5
leds-gpio: of: led should not be created if its status is disabled

now the leds-gpio driver will create every child led node without
checking the status is disabled or not.

for example, if we have a led node like d3, and its status is disabled:
leds {
d3 {
label = "d3";
gpios = <&pioE 24 0>;
status = "disabled";
};
};

we except the d3 should not be created. And the gpios should not be
request as well.

But current driver will create d3 and request its gpio.

This patch fix this by using for_each_available_child_of_node() and
of_get_available_child_count() to enumerate all child nodes. So the
disabled node will be inavailable.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-gpio.c