diff mbox series

[v4,10/12] test: dm: Test for default led naming

Message ID 20200624102947.359794-11-seanga2@gmail.com
State Accepted
Commit 3e41c7b253bc28278c3b3b6f49dfa4387290f5c4
Headers show
Series riscv: Add FPIOA and GPIO support for Kendryte K210 | expand

Commit Message

Sean Anderson June 24, 2020, 10:29 a.m. UTC
This modifies the existing led test to check for default led naming as
added in the previous patch.

Signed-off-by: Sean Anderson <seanga2 at gmail.com>
---

Changes in v4:
- New

 arch/sandbox/dts/test.dts | 2 +-
 test/dm/led.c             | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 36736f374d..3477adb346 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -460,7 +460,7 @@ 
 
 		default_off {
 			gpios = <&gpio_a 6 0>;
-			label = "sandbox:default_off";
+			/* label intentionally omitted */
 			default-state = "off";
 		};
 	};
diff --git a/test/dm/led.c b/test/dm/led.c
index 00de7b3997..d702cfb86f 100644
--- a/test/dm/led.c
+++ b/test/dm/led.c
@@ -39,7 +39,8 @@  static int dm_test_led_default_state(struct unit_test_state *uts)
 	ut_assertok(led_get_by_label("sandbox:default_on", &dev));
 	ut_asserteq(LEDST_ON, led_get_state(dev));
 
-	ut_assertok(led_get_by_label("sandbox:default_off", &dev));
+	/* Also tests default label behaviour */
+	ut_assertok(led_get_by_label("default_off", &dev));
 	ut_asserteq(LEDST_OFF, led_get_state(dev));
 
 	return 0;