Skip to content
Commit b0bb83df authored by Josh Wu's avatar Josh Wu Committed by Bryan Wu
Browse files

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: default avatarJosh Wu <josh.wu@atmel.com>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 954e04b9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment