summaryrefslogtreecommitdiff
path: root/drivers/led/led_gpio.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-07-06 12:54:34 -0600
committerSimon Glass <sjg@chromium.org>2015-07-21 17:39:32 -0600
commit3c43fba3d240a5d7b6042bfb834c274a8921ebd8 (patch)
treeb31c4d5ec04ad38ba87bce734c21be273384dd7e /drivers/led/led_gpio.c
parentfb8a5ffc77597a99678dbd5077f29ec9df54bdbe (diff)
dm: test: Add a test for the LED uclass
Add a test to confirm that we can adjust LEDs using the led_gpio driver. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/led/led_gpio.c')
-rw-r--r--drivers/led/led_gpio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/led/led_gpio.c b/drivers/led/led_gpio.c
index a4cd618787..cb6e996931 100644
--- a/drivers/led/led_gpio.c
+++ b/drivers/led/led_gpio.c
@@ -41,10 +41,16 @@ static int led_gpio_probe(struct udevice *dev)
static int led_gpio_remove(struct udevice *dev)
{
+ /*
+ * The GPIO driver may have already been removed. We will need to
+ * address this more generally.
+ */
+#ifndef CONFIG_SANDBOX
struct led_gpio_priv *priv = dev_get_priv(dev);
if (dm_gpio_is_valid(&priv->gpio))
dm_gpio_free(dev, &priv->gpio);
+#endif
return 0;
}