summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-07 01:21:39 +0300
committerSimon Glass <sjg@chromium.org>2018-11-21 05:14:22 +0300
commit8729b1ae2cbda83059a55811614a2b0dbfdf7e53 (patch)
tree65fa9cfd636340f9c9fc97bb3fa76de36c5bf1e2 /test
parent96794a3eaee9bf368efe475f0a040d0e08b09dc9 (diff)
downloadu-boot-8729b1ae2cbda83059a55811614a2b0dbfdf7e53.tar.xz
misc: Update read() and write() methods to return bytes xfered
At present these functions return 0 on success. For some devices we want to know how many bytes were transferred. It seems useful to adjust the API to be more like the POSIX read() and write() functions. Update these two methods, a test and all users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'test')
-rw-r--r--test/dm/misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/dm/misc.c b/test/dm/misc.c
index 61279665ef..4d4232adf1 100644
--- a/test/dm/misc.c
+++ b/test/dm/misc.c
@@ -21,9 +21,9 @@ static int dm_test_misc(struct unit_test_state *uts)
ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "misc-test", &dev));
/* Read / write tests */
- ut_assertok(misc_write(dev, 0, "TEST", 4));
- ut_assertok(misc_write(dev, 4, "WRITE", 5));
- ut_assertok(misc_read(dev, 0, buf, 9));
+ ut_asserteq(4, misc_write(dev, 0, "TEST", 4));
+ ut_asserteq(5, misc_write(dev, 4, "WRITE", 5));
+ ut_asserteq(9, misc_read(dev, 0, buf, 9));
ut_assertok(memcmp(buf, "TESTWRITE", 9));