summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-18 08:14:34 -0700
committerSimon Glass <sjg@chromium.org>2018-11-29 09:30:05 -0700
commit031a650e1309a086f6794cde35b1b1b851a9e926 (patch)
treea2b6743e36597b2aec9411144028943b254e85ac /test/dm
parentb7c25b11b6a1e3f840464224309b72a91b65bc56 (diff)
dm: sandbox: i2c: Use new emulator parent uclass
Update the device tree, sandbox i2c driver and tests to use the new emulation parent to hold emulators. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/i2c.c2
-rw-r--r--test/dm/rtc.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/test/dm/i2c.c b/test/dm/i2c.c
index 772f62b265..cbbd4aa29a 100644
--- a/test/dm/i2c.c
+++ b/test/dm/i2c.c
@@ -35,7 +35,7 @@ static int dm_test_i2c_find(struct unit_test_state *uts)
*/
ut_assertok(uclass_get_device_by_seq(UCLASS_I2C, busnum, &bus));
ut_assertok(dm_i2c_probe(bus, chip, 0, &dev));
- ut_asserteq(-ENODEV, dm_i2c_probe(bus, no_chip, 0, &dev));
+ ut_asserteq(-ENOENT, dm_i2c_probe(bus, no_chip, 0, &dev));
ut_asserteq(-ENODEV, uclass_get_device_by_seq(UCLASS_I2C, 1, &bus));
return 0;
diff --git a/test/dm/rtc.c b/test/dm/rtc.c
index e2bc648fdc..7188742764 100644
--- a/test/dm/rtc.c
+++ b/test/dm/rtc.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <dm.h>
+#include <i2c.h>
#include <rtc.h>
#include <asm/io.h>
#include <asm/test.h>
@@ -60,7 +61,7 @@ static int dm_test_rtc_set_get(struct unit_test_state *uts)
ut_assertok(uclass_get_device(UCLASS_RTC, 0, &dev));
ut_assertok(dm_rtc_get(dev, &now));
- ut_assertok(device_find_first_child(dev, &emul));
+ ut_assertok(i2c_emul_find(dev, &emul));
ut_assert(emul != NULL);
/* Tell the RTC to go into manual mode */
@@ -125,7 +126,7 @@ static int dm_test_rtc_reset(struct unit_test_state *uts)
ut_assertok(uclass_get_device(UCLASS_RTC, 0, &dev));
ut_assertok(dm_rtc_get(dev, &now));
- ut_assertok(device_find_first_child(dev, &emul));
+ ut_assertok(i2c_emul_find(dev, &emul));
ut_assert(emul != NULL);
old_base_time = sandbox_i2c_rtc_get_set_base_time(emul, 0);
@@ -154,9 +155,9 @@ static int dm_test_rtc_dual(struct unit_test_state *uts)
ut_assertok(uclass_get_device(UCLASS_RTC, 1, &dev2));
ut_assertok(dm_rtc_get(dev2, &now2));
- ut_assertok(device_find_first_child(dev1, &emul1));
+ ut_assertok(i2c_emul_find(dev1, &emul1));
ut_assert(emul1 != NULL);
- ut_assertok(device_find_first_child(dev2, &emul2));
+ ut_assertok(i2c_emul_find(dev2, &emul2));
ut_assert(emul2 != NULL);
offset = sandbox_i2c_rtc_set_offset(emul1, false, -1);