All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 52/71] dm: test: Separate out the bus DT offset test
Date: Wed, 10 May 2017 08:21:31 -0600	[thread overview]
Message-ID: <20170510142150.30515-53-sjg@chromium.org> (raw)
In-Reply-To: <20170510142150.30515-1-sjg@chromium.org>

We cannot access the device tree via an offset when running in livetree
mode. Separate out that part of the bus' children tests and mark it as
for the flat tree only.

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

Changes in v2: None

 test/dm/bus.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/test/dm/bus.c b/test/dm/bus.c
index 6a2773565e..8ba75d4b7d 100644
--- a/test/dm/bus.c
+++ b/test/dm/bus.c
@@ -160,8 +160,21 @@ static int dm_test_bus_children_funcs(struct unit_test_state *uts)
 	node = fdt_path_offset(blob, "/d-test");
 	ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev));
 
+	return 0;
+}
+DM_TEST(dm_test_bus_children_funcs, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+static int dm_test_bus_children_of_offset(struct unit_test_state *uts)
+{
+	const void *blob = gd->fdt_blob;
+	struct udevice *bus, *dev;
+	int node;
+
+	ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
+
 	/* Find a valid child */
 	node = fdt_path_offset(blob, "/some-bus/c-test at 1");
+	ut_assert(node > 0);
 	ut_assertok(device_find_child_by_of_offset(bus, node, &dev));
 	ut_assert(!(dev->flags & DM_FLAG_ACTIVATED));
 	ut_assertok(device_get_child_by_of_offset(bus, node, &dev));
@@ -169,7 +182,8 @@ static int dm_test_bus_children_funcs(struct unit_test_state *uts)
 
 	return 0;
 }
-DM_TEST(dm_test_bus_children_funcs, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+DM_TEST(dm_test_bus_children_of_offset,
+	DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT | DM_TESTF_FLAT_TREE);
 
 /* Test that we can iterate through children */
 static int dm_test_bus_children_iterators(struct unit_test_state *uts)
-- 
2.13.0.rc2.291.g57267f2277-goog

  parent reply	other threads:[~2017-05-10 14:21 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 14:20 [U-Boot] [PATCH v2 00/71] dm: Add support for a 'live' device tree Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 01/71] dm: core: Set return value first in lists_bind_fdt() Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 02/71] Update WARN_ON() to return a value Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 03/71] dm: core: Add livetree definitions Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 04/71] dm: core: Add livetree access functions Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 05/71] dm: Add a function to create a 'live' device tree Simon Glass
2017-05-11 14:59   ` Lothar Waßmann
2017-05-15  3:03     ` Simon Glass
2017-05-15  7:34       ` Lothar Waßmann
2017-05-16  0:18         ` Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 06/71] dm: Build a live tree after relocation Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 07/71] dm: core: Rename of_device_is_compatible() Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 08/71] dm: core: Add operations on device tree references Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 09/71] dm: core: Add livetree address functions Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 10/71] fdt: Update fdt_get_base_address() to use const Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 11/71] dm: core: Add address operations on device tree references Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 12/71] dm: core: Add a place to put extra device-tree reading functions Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 13/71] dm: core: Add device-based 'read' functions to access DT Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 14/71] dm: core: Implement live tree 'read' functions Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 15/71] dm: core: Allow binding a device from a live tree Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 16/71] dm: core: Update lists_bind_fdt() to use ofnode Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 17/71] dm: core: Update device_bind_driver_to_node() " Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 18/71] dm: core: Scan the live tree when setting up driver model Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 19/71] dm: core: Add a way to find a device by ofnode Simon Glass
2017-05-10 14:20 ` [U-Boot] [PATCH v2 20/71] dm: regmap: Add support for livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 21/71] dm: simple-bus: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 22/71] dm: core: Update uclass_find_device_by_phandle() " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 23/71] sandbox: Add a way to reset sandbox state for tests Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 24/71] dm: test: Move test running code into a separate function Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 25/71] dm: test: Show the test filename when running Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 26/71] dm: test: Add support for running tests with livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 27/71] dm: core: Run tests with both livetree and flat tree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 28/71] dm: gpio: Refactor to prepare for live tree support Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 29/71] dm: gpio: Drop blank line in gpio_xlate_offs_flags() comment Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 30/71] dm: gpio: sandbox: Use dev_read...() functions to access DT Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 31/71] dm: gpio: Add live tree support Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 32/71] cros_ec: Fix debug() statement in ec_command_inptr() Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 33/71] cros_ec: Convert to support live tree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 34/71] sandbox: Add a new sandbox_flattree board Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 35/71] test: Update 'make test' to run more tests Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 36/71] fdt: Rename a few functions in fdt_support Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 37/71] dm: Add more livetree helpers and definitions Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 38/71] string: Add strchrnul() Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 39/71] string: Add strcspn() Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 40/71] dm: i2c: Convert uclass to livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 41/71] dm: pmic: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 42/71] sandbox: pmic: Convert pmic emulator to support livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 43/71] dm: regulator: Convert regulator uclass " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 44/71] dm: regulator: Update fixed regulator " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 45/71] dm: mmc: Convert uclass to livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 46/71] dm: adc: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 47/71] dm: usb: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 48/71] sandbox: usb: Convert emulators " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 49/71] clk: Modify xlate() method for livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 50/71] dm: clk: Update uclass to support livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 51/71] dm: clk: fixed: Update " Simon Glass
2017-05-10 14:21 ` Simon Glass [this message]
2017-05-10 14:21 ` [U-Boot] [PATCH v2 53/71] dm: test: Disable the fdt_offset test with livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 54/71] dm: phy: Update tests to use ut_asserteq() Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 55/71] dm: mailbox: Update uclass to support livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 56/71] dm: phy: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 57/71] sandbox: phy: Update driver for livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 58/71] dm: power-domain: Update uclass to support livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 59/71] dm: reset: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 60/71] dm: pci: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 61/71] dm: Update the I2C eeprom driver for livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 62/71] cros_ec: Update the cros_ec keyboard driver to livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 63/71] dm: spi: Convert uclass " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 64/71] dm: sandbox: i2c: Drop fdtdec.h header Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 65/71] dm: sandbox: i2c_rtc: " Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 66/71] dm: spi-flash: Convert uclass to livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 67/71] dm: sandbox: spi: Convert driver to support livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 68/71] dm: sandbox: sysreset: Convert driver to livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 69/71] dm: test: Fix nit with position of backslash Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 70/71] dm: gpio: power: Convert pm8916 drivers to livetree Simon Glass
2017-05-10 14:21 ` [U-Boot] [PATCH v2 71/71] sandbox: Move to use live tree Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170510142150.30515-53-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.