Lines Matching +full:gpio +full:- +full:leds
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
7 #include <linux/leds.h>
12 * gpio_led_register_device - register a gpio-led device
16 * Makes a copy of pdata and pdata->leds and registers a new leds-gpio device
17 * with the result. This allows to have pdata and pdata-leds in .init.rodata
29 if (!pdata->num_leds) in gpio_led_register_device()
30 return ERR_PTR(-EINVAL); in gpio_led_register_device()
32 _pdata.leds = kmemdup(pdata->leds, in gpio_led_register_device()
33 pdata->num_leds * sizeof(*pdata->leds), GFP_KERNEL); in gpio_led_register_device()
34 if (!_pdata.leds) in gpio_led_register_device()
35 return ERR_PTR(-ENOMEM); in gpio_led_register_device()
37 ret = platform_device_register_resndata(NULL, "leds-gpio", id, in gpio_led_register_device()
40 kfree(_pdata.leds); in gpio_led_register_device()