+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (c) 2015 Google, Inc
* Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <asm/gpio.h>
#include <dm/lists.h>
-DECLARE_GLOBAL_DATA_PTR;
-
struct led_gpio_priv {
struct gpio_desc gpio;
};
{
struct led_uc_plat *uc_plat = dev_get_uclass_platdata(dev);
struct led_gpio_priv *priv = dev_get_priv(dev);
+ int ret;
/* Ignore the top-level LED node */
if (!uc_plat->label)
return 0;
- return gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT);
+
+ ret = gpio_request_by_name(dev, "gpios", 0, &priv->gpio, GPIOD_IS_OUT);
+ if (ret)
+ return ret;
+
+ return 0;
}
static int led_gpio_remove(struct udevice *dev)