[U-Boot] [PATCH v3 6/6] test: dm: Fix wrong aliases property names

Eugeniu Rosca roscaeugeniu at gmail.com
Sat May 19 12:13:55 UTC 2018


After importing v4.17-rc1 Linux commit 9130ba884640 ("scripts/dtc:
Update to upstream version v1.4.6-9-gaadd0b65c987"), sandbox build
reports below warnings:

arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'
arch/sandbox/dts/test.dtb: Warning (alias_paths): /aliases: aliases property name must include only lowercase and '-'

Silent them by applying the 's/_/-/' substitution in the names of the
'fdt_dummy0', 'fdt_dummy1', 'fdt_dummy2', 'fdt_dummy3' properties.

Similar DTC warnings have been recently fixed in Linux kernel, e.g. via
v4.17-rc1 commit d366c30d19f4 ("ARM: dts: STi: Fix aliases property name
for STi boards").

If done alone, the DTS update generates a failure of the
`ut dm fdt_translation` unit test in sandbox environment as seen below:

$ ./u-boot -d arch/sandbox/dts/test.dtb
---<-snip->---
=> ut dm fdt_translation
Test: dm_test_fdt_translation: test-fdt.c
test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19
Test: dm_test_fdt_translation: test-fdt.c (flat tree)
test/dm/test-fdt.c:444, dm_test_fdt_translation(): 0 == uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, 1, &dev): Expected 0, got -19
Failures: 2
---<-snip->---

Fix this issue in place, by updating the "name" string in the
UCLASS_DRIVER(fdt_dummy) definition, so that it matches the newly
updated aliases properties. After that, the test passes:

$ ./u-boot -d arch/sandbox/dts/test.dtb
---<-snip->---
=> ut dm fdt_translation
Test: dm_test_fdt_translation: test-fdt.c
Test: dm_test_fdt_translation: test-fdt.c (flat tree)
Failures: 0
---<-snip->---

Fixes: e8d5291824e2 ("core: ofnode: Fix translation for #size-cells == 0")
Reported-by: Petr Vorel <pvorel at suse.cz>
Signed-off-by: Eugeniu Rosca <erosca at de.adit-jv.com>
---

v2->v3:
* Fixed an issue in the test code (test/dm/test-fdt.c) generated by the
  DTS update (arch/sandbox/dts/test.dts) in [PATCH v2].
* Changed commit summary line, to cover test/dm/test-fdt.c.
* Added: Reported-by: Petr Vorel <pvorel at suse.cz>
* [Due to update] Dropped: Reviewed-by: Simon Glass <sjg at chromium.org>

v1->v2:
* Newly pushed

 arch/sandbox/dts/test.dts | 8 ++++----
 test/dm/test-fdt.c        | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 683b1970e0af..3e87c5c0f3fd 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -27,10 +27,10 @@
 		testfdt3 = "/b-test";
 		testfdt5 = "/some-bus/c-test at 5";
 		testfdt8 = "/a-test";
-		fdt_dummy0 = "/translation-test at 8000/dev at 0,0";
-		fdt_dummy1 = "/translation-test at 8000/dev at 1,100";
-		fdt_dummy2 = "/translation-test at 8000/dev at 2,200";
-		fdt_dummy3 = "/translation-test at 8000/noxlatebus at 3,300/dev at 42";
+		fdt-dummy0 = "/translation-test at 8000/dev at 0,0";
+		fdt-dummy1 = "/translation-test at 8000/dev at 1,100";
+		fdt-dummy2 = "/translation-test at 8000/dev at 2,200";
+		fdt-dummy3 = "/translation-test at 8000/noxlatebus at 3,300/dev at 42";
 		usb0 = &usb_0;
 		usb1 = &usb_1;
 		usb2 = &usb_2;
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 8196844e89a7..66d0df5629a2 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -425,7 +425,7 @@ static const struct udevice_id fdt_dummy_ids[] = {
 };
 
 UCLASS_DRIVER(fdt_dummy) = {
-	.name		= "fdt_dummy",
+	.name		= "fdt-dummy",
 	.id		= UCLASS_TEST_DUMMY,
 	.flags		= DM_UC_FLAG_SEQ_ALIAS,
 };
-- 
2.17.0



More information about the U-Boot mailing list