diff options
author | Tom Rini <trini@konsulko.com> | 2016-03-14 23:21:44 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-03-14 23:21:44 (GMT) |
commit | 88033d737d9f46e7eebda6a8f9770957eb9aae9c (patch) | |
tree | 0b7c3bc6caa5ab4b7f8e88f05ce51ace87f25890 /test/dm/usb.c | |
parent | 9f0f432c0aea1e70959a0c06938459d3175a36b0 (diff) | |
parent | 608e399fdef82e983db44c5cb8f5e772bba870e2 (diff) | |
download | u-boot-fsl-qoriq-88033d737d9f46e7eebda6a8f9770957eb9aae9c.tar.xz |
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'test/dm/usb.c')
-rw-r--r-- | test/dm/usb.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/dm/usb.c b/test/dm/usb.c index 3a2e52b..b46ae60 100644 --- a/test/dm/usb.c +++ b/test/dm/usb.c @@ -39,19 +39,20 @@ DM_TEST(dm_test_usb_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); static int dm_test_usb_flash(struct unit_test_state *uts) { struct udevice *dev; - block_dev_desc_t *dev_desc; + struct blk_desc *dev_desc; char cmp[1024]; state_set_skip_delays(true); ut_assertok(usb_init()); ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &dev)); - ut_assertok(get_device("usb", "0", &dev_desc)); + ut_assertok(blk_get_device_by_str("usb", "0", &dev_desc)); /* Read a few blocks and look for the string we expect */ ut_asserteq(512, dev_desc->blksz); memset(cmp, '\0', sizeof(cmp)); - ut_asserteq(2, dev_desc->block_read(dev_desc, 0, 2, cmp)); + ut_asserteq(2, blk_dread(dev_desc, 0, 2, cmp)); ut_assertok(strcmp(cmp, "this is a test")); + ut_assertok(usb_stop()); return 0; } @@ -67,6 +68,7 @@ static int dm_test_usb_multi(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 1, &dev)); ut_assertok(uclass_get_device(UCLASS_MASS_STORAGE, 2, &dev)); + ut_assertok(usb_stop()); return 0; } |