diff mbox

[U-Boot,v3,02/29] dm: Use an explicit expect value in core tests

Message ID 1406120124-9373-3-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 23, 2014, 12:54 p.m. UTC
Rather than reusing the 'reg' property, use an explicit property for the
expected ping value used in testing.

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

Changes in v3: None
Changes in v2: None

 test/dm/test-fdt.c | 13 ++++++++-----
 test/dm/test.dts   |  5 ++++-
 2 files changed, 12 insertions(+), 6 deletions(-)

Comments

Simon Glass July 26, 2014, 3:02 p.m. UTC | #1
On 23 July 2014 13:54, Simon Glass <sjg@chromium.org> wrote:
> Rather than reusing the 'reg' property, use an explicit property for the
> expected ping value used in testing.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None

Applied to dm/master.

>
>  test/dm/test-fdt.c | 13 ++++++++-----
>  test/dm/test.dts   |  5 ++++-
>  2 files changed, 12 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 98e3936..0f50537 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -39,7 +39,8 @@  static int testfdt_ofdata_to_platdata(struct udevice *dev)
 
 	pdata->ping_add = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
 					"ping-add", -1);
-	pdata->base = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
+	pdata->base = fdtdec_get_addr(gd->fdt_blob, dev->of_offset,
+				      "ping-expect");
 
 	return 0;
 }
@@ -127,11 +128,13 @@  static int dm_test_fdt(struct dm_test_state *dms)
 		ut_assert(!ret);
 
 		/*
-		 * Get the 'reg' property, which tells us what the ping add
-		 * should be. We don't use the platdata because we want
-		 * to test the code that sets that up (testfdt_drv_probe()).
+		 * Get the 'ping-expect' property, which tells us what the
+		 * ping add should be. We don't use the platdata because we
+		 * want to test the code that sets that up
+		 * (testfdt_drv_probe()).
 		 */
-		base = fdtdec_get_addr(gd->fdt_blob, dev->of_offset, "reg");
+		base = fdtdec_get_addr(gd->fdt_blob, dev->of_offset,
+				       "ping-expect");
 		debug("dev=%d, base=%d: %s\n", i, base,
 		      fdt_get_name(gd->fdt_blob, dev->of_offset, NULL));
 
diff --git a/test/dm/test.dts b/test/dm/test.dts
index ec5364f..74d236b 100644
--- a/test/dm/test.dts
+++ b/test/dm/test.dts
@@ -9,6 +9,7 @@ 
 	a-test {
 		reg = <0>;
 		compatible = "denx,u-boot-fdt-test";
+		ping-expect = <0>;
 		ping-add = <0>;
 	};
 
@@ -24,13 +25,14 @@ 
 	b-test {
 		reg = <3>;
 		compatible = "denx,u-boot-fdt-test";
+		ping-expect = <3>;
 		ping-add = <3>;
 	};
 
 	some-bus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-		reg = <4>;
+		ping-expect = <4>;
 		ping-add = <4>;
 		c-test {
 			compatible = "denx,u-boot-fdt-test";
@@ -41,6 +43,7 @@ 
 
 	d-test {
 		reg = <6>;
+		ping-expect = <6>;
 		ping-add = <6>;
 		compatible = "google,another-fdt-test";
 	};