diff options
Diffstat (limited to 'drivers/led/led_gpio.c')
-rw-r--r-- | drivers/led/led_gpio.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c index 958dbd31e7..fbed151b5d 100644 --- a/drivers/led/led_gpio.c +++ b/drivers/led/led_gpio.c @@ -57,19 +57,9 @@ static enum led_state_t gpio_led_get_state(struct udevice *dev) static int led_gpio_probe(struct udevice *dev) { - struct led_uc_plat *uc_plat = dev_get_uclass_plat(dev); struct led_gpio_priv *priv = dev_get_priv(dev); - int ret; - - /* Ignore the top-level LED node */ - if (!uc_plat->label) - return 0; - - ret = gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT); - if (ret) - return ret; - return 0; + return gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT); } static int led_gpio_remove(struct udevice *dev) @@ -110,18 +100,23 @@ static const struct led_ops gpio_led_ops = { .get_state = gpio_led_get_state, }; -static const struct udevice_id led_gpio_ids[] = { - { .compatible = "gpio-leds" }, - { } -}; - U_BOOT_DRIVER(led_gpio) = { .name = "gpio_led", .id = UCLASS_LED, - .of_match = led_gpio_ids, .ops = &gpio_led_ops, .priv_auto = sizeof(struct led_gpio_priv), - .bind = led_gpio_bind, .probe = led_gpio_probe, .remove = led_gpio_remove, }; + +static const struct udevice_id led_gpio_ids[] = { + { .compatible = "gpio-leds" }, + { } +}; + +U_BOOT_DRIVER(led_gpio_wrap) = { + .name = "gpio_led_wrap", + .id = UCLASS_NOP, + .of_match = led_gpio_ids, + .bind = led_gpio_bind, +}; |