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>
This commit is contained in:
Simon Glass
2015-07-06 12:54:34 -06:00
parent fb8a5ffc77
commit 3c43fba3d2
5 changed files with 95 additions and 0 deletions

View File

@@ -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;
}