Re: [PATCH] leds: leds-gpio: Use of_get_child_count() helper

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

 



On Tue, Aug 21, 2012 at 5:21 PM, Tobias Klauser <klto@xxxxxxx> wrote:
> Use of_get_child_count() instead of custom implementation.
>
> Signed-off-by: Tobias Klauser <klto@xxxxxxx>

Thanks, applied to my for-next
-Bryan

> ---
>  drivers/leds/leds-gpio.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index c392c1e..cde85ba 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -170,11 +170,10 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev
>  {
>         struct device_node *np = pdev->dev.of_node, *child;
>         struct gpio_leds_priv *priv;
> -       int count = 0, ret;
> +       int count, ret;
>
>         /* count LEDs in this device, so we know how much to allocate */
> -       for_each_child_of_node(np, child)
> -               count++;
> +       count = of_get_child_count(np);
>         if (!count)
>                 return NULL;
>
> --
> 1.7.5.4
>



-- 
Bryan Wu <bryan.wu@xxxxxxxxxxxxx>
Kernel Developer    +86.186-168-78255 Mobile
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux