diff mbox series

test: dm: test-fdt: Use fdtdec_get_int() in dm_check_devices()

Message ID 20230823193744.64172-1-marek.vasut+renesas@mailbox.org
State Accepted
Commit ed48da33927c78e6523753f0969f696cf7bf6f9e
Delegated to: Tom Rini
Headers show
Series test: dm: test-fdt: Use fdtdec_get_int() in dm_check_devices() | expand

Commit Message

Marek Vasut Aug. 23, 2023, 7:37 p.m. UTC
The current fdtdec_get_addr() takes into consideration #address-cells
and #size-cells for "ping-expect" property which is clearly neither.
Use fdtdec_get_int() instead and return negative one in case the
property is not in DT or the platform under test is not DT based,
i.e. mimic the current fdtdec_get_addr() behavior.

This fixes ut dm dm_test_bus_children test.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Mario Six <mario.six@gdsys.cc>
Cc: Simon Glass <sjg@chromium.org>
---
 test/dm/test-fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass Aug. 23, 2023, 11:57 p.m. UTC | #1
On Wed, 23 Aug 2023 at 13:38, Marek Vasut
<marek.vasut+renesas@mailbox.org> wrote:
>
> The current fdtdec_get_addr() takes into consideration #address-cells
> and #size-cells for "ping-expect" property which is clearly neither.
> Use fdtdec_get_int() instead and return negative one in case the
> property is not in DT or the platform under test is not DT based,
> i.e. mimic the current fdtdec_get_addr() behavior.
>
> This fixes ut dm dm_test_bus_children test.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: Mario Six <mario.six@gdsys.cc>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  test/dm/test-fdt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini Sept. 7, 2023, 1:53 a.m. UTC | #2
On Wed, Aug 23, 2023 at 09:37:44PM +0200, Marek Vasut wrote:

> The current fdtdec_get_addr() takes into consideration #address-cells
> and #size-cells for "ping-expect" property which is clearly neither.
> Use fdtdec_get_int() instead and return negative one in case the
> property is not in DT or the platform under test is not DT based,
> i.e. mimic the current fdtdec_get_addr() behavior.
> 
> This fixes ut dm dm_test_bus_children test.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index eeecd1dc2de..72d0eb57e21 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -135,8 +135,8 @@  int dm_check_devices(struct unit_test_state *uts, int num_devices)
 		 * want to test the code that sets that up
 		 * (testfdt_drv_probe()).
 		 */
-		base = fdtdec_get_addr(gd->fdt_blob, dev_of_offset(dev),
-				       "ping-expect");
+		base = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
+				      "ping-expect", -1);
 		debug("dev=%d, base=%d: %s\n", i, base,
 		      fdt_get_name(gd->fdt_blob, dev_of_offset(dev), NULL));