aboutsummaryrefslogtreecommitdiff
path: root/test/dm/spi.c
diff options
context:
space:
mode:
authorSimon Glass2018-06-11 13:07:16 -0600
committerSimon Glass2018-07-09 09:11:00 -0600
commit008dcddf9937bd2576f98b48eb5bf0f60ad36014 (patch)
tree751ddfe6e97f7e2e2df1d6f542e77d0d34fa5503 /test/dm/spi.c
parentd677b00cb62a4cf4d4a24468f218581b4f57c2fe (diff)
dm: spi: Update sandbox SPI emulation driver to use ofnode
Update the parameters sandbox_sf_bind_emul to support livetree. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm/spi.c')
-rw-r--r--test/dm/spi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/dm/spi.c b/test/dm/spi.c
index 252b87431fb..ffd789cd7fb 100644
--- a/test/dm/spi.c
+++ b/test/dm/spi.c
@@ -23,7 +23,7 @@ static int dm_test_spi_find(struct unit_test_state *uts)
struct udevice *bus, *dev;
const int busnum = 0, cs = 0, mode = 0, speed = 1000000, cs_b = 1;
struct spi_cs_info info;
- int of_offset;
+ ofnode node;
ut_asserteq(-ENODEV, uclass_find_device_by_seq(UCLASS_SPI, busnum,
false, &bus));
@@ -34,7 +34,7 @@ static int dm_test_spi_find(struct unit_test_state *uts)
*/
ut_asserteq(0, uclass_get_device_by_seq(UCLASS_SPI, busnum, &bus));
ut_assertok(spi_cs_info(bus, cs, &info));
- of_offset = dev_of_offset(info.dev);
+ node = dev_ofnode(info.dev);
device_remove(info.dev, DM_REMOVE_NORMAL);
device_unbind(info.dev);
@@ -65,7 +65,7 @@ static int dm_test_spi_find(struct unit_test_state *uts)
ut_asserteq_ptr(NULL, info.dev);
/* Add the emulation and try again */
- ut_assertok(sandbox_sf_bind_emul(state, busnum, cs, bus, of_offset,
+ ut_assertok(sandbox_sf_bind_emul(state, busnum, cs, bus, node,
"name"));
ut_assertok(spi_find_bus_and_cs(busnum, cs, &bus, &dev));
ut_assertok(spi_get_bus_and_cs(busnum, cs, speed, mode,
@@ -75,7 +75,7 @@ static int dm_test_spi_find(struct unit_test_state *uts)
ut_asserteq_ptr(info.dev, slave->dev);
/* We should be able to add something to another chip select */
- ut_assertok(sandbox_sf_bind_emul(state, busnum, cs_b, bus, of_offset,
+ ut_assertok(sandbox_sf_bind_emul(state, busnum, cs_b, bus, node,
"name"));
ut_assertok(spi_get_bus_and_cs(busnum, cs_b, speed, mode,
"spi_flash_std", "name", &bus, &slave));