sandbox: led: use new function to configure default state

Initialize the led with the default state defined in device tree
in board_init and solve issue with test for led default state.

Reviewed-by: Simon Glass <sjg@chromium.org>

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
Patrick Delaunay
2018-07-27 16:37:09 +02:00
committed by Tom Rini
parent 1f5118b4d3
commit 17585e2dc3
3 changed files with 14 additions and 1 deletions

View File

@@ -32,6 +32,9 @@ static int dm_test_led_default_state(struct unit_test_state *uts)
{
struct udevice *dev;
/* configure the default state (auto-probe) */
led_default_state();
/* Check that we handle the default-state property correctly. */
ut_assertok(led_get_by_label("sandbox:default_on", &dev));
ut_asserteq(LEDST_ON, led_get_state(dev));