aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/leds/leds-gpio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 7ccafdeab9c1..78b0e273a903 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -171,11 +171,11 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
171 int count, ret; 171 int count, ret;
172 172
173 /* count LEDs in this device, so we know how much to allocate */ 173 /* count LEDs in this device, so we know how much to allocate */
174 count = of_get_child_count(np); 174 count = of_get_available_child_count(np);
175 if (!count) 175 if (!count)
176 return ERR_PTR(-ENODEV); 176 return ERR_PTR(-ENODEV);
177 177
178 for_each_child_of_node(np, child) 178 for_each_available_child_of_node(np, child)
179 if (of_get_gpio(child, 0) == -EPROBE_DEFER) 179 if (of_get_gpio(child, 0) == -EPROBE_DEFER)
180 return ERR_PTR(-EPROBE_DEFER); 180 return ERR_PTR(-EPROBE_DEFER);
181 181
@@ -184,7 +184,7 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
184 if (!priv) 184 if (!priv)
185 return ERR_PTR(-ENOMEM); 185 return ERR_PTR(-ENOMEM);
186 186
187 for_each_child_of_node(np, child) { 187 for_each_available_child_of_node(np, child) {
188 struct gpio_led led = {}; 188 struct gpio_led led = {};
189 enum of_gpio_flags flags; 189 enum of_gpio_flags flags;
190 const char *state; 190 const char *state;