On Thu, Apr 16, 2015 at 12:30 AM, Jacek Anaszewski
<[email protected]> wrote:
> Make sure that already registered LEDs will be torn down properly
> if the name of the next LED to create is unavailable.
>

Thanks, merged.
-Bryan

> Signed-off-by: Jacek Anaszewski <[email protected]>
> Cc: Bryan Wu <[email protected]>
> Cc: Richard Purdie <[email protected]>
> ---
>  drivers/leds/leds-gpio.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 25df4a2..c3db74a 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -198,8 +198,10 @@ static struct gpio_leds_priv *gpio_leds_create(struct 
> platform_device *pdev)
>                 } else {
>                         if (IS_ENABLED(CONFIG_OF) && !led.name && np)
>                                 led.name = np->name;
> -                       if (!led.name)
> -                               return ERR_PTR(-EINVAL);
> +                       if (!led.name) {
> +                               ret = -EINVAL;
> +                               goto err;
> +                       }
>                 }
>                 fwnode_property_read_string(child, "linux,default-trigger",
>                                             &led.default_trigger);
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to