ut_assertok(uclass_get_device(UCLASS_LED, 1, &dev));
ut_assertok(uclass_get_device(UCLASS_LED, 2, &dev));
ut_assertok(uclass_get_device(UCLASS_LED, 3, &dev));
- ut_assertok(uclass_get_device(UCLASS_LED, 4, &dev));
- ut_asserteq(-ENODEV, uclass_get_device(UCLASS_LED, 5, &dev));
+ ut_asserteq(-ENODEV, uclass_get_device(UCLASS_LED, 4, &dev));
return 0;
}
struct udevice *dev, *gpio;
/*
- * Check that we can manipulate an LED. LED 1 is connected to GPIO
+ * Check that we can manipulate an LED. LED 0 is connected to GPIO
* bank gpio_a, offset 1.
*/
- ut_assertok(uclass_get_device(UCLASS_LED, 1, &dev));
+ ut_assertok(uclass_get_device(UCLASS_LED, 0, &dev));
ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio));
ut_asserteq(0, sandbox_gpio_get_value(gpio, offset));
ut_assertok(led_set_state(dev, LEDST_ON));
struct udevice *dev, *gpio;
/*
- * Check that we can manipulate an LED. LED 1 is connected to GPIO
+ * Check that we can manipulate an LED. LED 0 is connected to GPIO
* bank gpio_a, offset 1.
*/
- ut_assertok(uclass_get_device(UCLASS_LED, 1, &dev));
+ ut_assertok(uclass_get_device(UCLASS_LED, 0, &dev));
ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio));
ut_asserteq(0, sandbox_gpio_get_value(gpio, offset));
ut_assertok(led_set_state(dev, LEDST_TOGGLE));
ut_assertok(led_get_by_label("sandbox:red", &dev));
ut_asserteq(1, device_active(dev));
- ut_assertok(uclass_get_device(UCLASS_LED, 1, &cmp));
+ ut_assertok(uclass_get_device(UCLASS_LED, 0, &cmp));
ut_asserteq_ptr(dev, cmp);
ut_assertok(led_get_by_label("sandbox:green", &dev));
ut_asserteq(1, device_active(dev));
- ut_assertok(uclass_get_device(UCLASS_LED, 2, &cmp));
+ ut_assertok(uclass_get_device(UCLASS_LED, 1, &cmp));
ut_asserteq_ptr(dev, cmp);
ut_asserteq(-ENODEV, led_get_by_label("sandbox:blue", &dev));
* Check that we get an error when trying to blink an LED, since it is
* not supported by the GPIO LED driver.
*/
- ut_assertok(uclass_get_device(UCLASS_LED, 1, &dev));
+ ut_assertok(uclass_get_device(UCLASS_LED, 0, &dev));
ut_assertok(uclass_get_device(UCLASS_GPIO, 1, &gpio));
ut_asserteq(0, sandbox_gpio_get_value(gpio, offset));
ut_asserteq(-ENOSYS, led_set_state(dev, LEDST_BLINK));