aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/misc_sandbox.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-11-06 15:21:39 -0700
committerSimon Glass <sjg@chromium.org>2018-11-20 19:14:22 -0700
commit8729b1ae2cbda83059a55811614a2b0dbfdf7e53 (patch)
tree65fa9cfd636340f9c9fc97bb3fa76de36c5bf1e2 /drivers/misc/misc_sandbox.c
parent96794a3eaee9bf368efe475f0a040d0e08b09dc9 (diff)
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 'drivers/misc/misc_sandbox.c')
-rw-r--r--drivers/misc/misc_sandbox.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/misc_sandbox.c b/drivers/misc/misc_sandbox.c
index e4164f76fb..f7c5b2e25f 100644
--- a/drivers/misc/misc_sandbox.c
+++ b/drivers/misc/misc_sandbox.c
@@ -20,7 +20,7 @@ int misc_sandbox_read(struct udevice *dev, int offset, void *buf, int size)
memcpy(buf, priv->mem + offset, size);
- return 0;
+ return size;
}
int misc_sandbox_write(struct udevice *dev, int offset, const void *buf,
@@ -30,7 +30,7 @@ int misc_sandbox_write(struct udevice *dev, int offset, const void *buf,
memcpy(priv->mem + offset, buf, size);
- return 0;
+ return size;
}
int misc_sandbox_ioctl(struct udevice *dev, unsigned long request, void *buf)