summaryrefslogtreecommitdiff
path: root/drivers/dfu/dfu.c
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2017-07-19 16:39:22 +0200
committerMarek Vasut <marex@denx.de>2017-07-28 23:34:38 +0200
commit4de512018ba7d57f1672be21c7459281f7c97514 (patch)
treeca142a43fc4dde3780e35568eedbbe26dbeec39c /drivers/dfu/dfu.c
parentbab0146ea91146aafa8cf10a34a45ae85eca5683 (diff)
downloadu-boot-4de512018ba7d57f1672be21c7459281f7c97514.tar.gz
u-boot-4de512018ba7d57f1672be21c7459281f7c97514.tar.bz2
u-boot-4de512018ba7d57f1672be21c7459281f7c97514.zip
dfu: allow dfu read on partition greater than 2GB
solve issue on get_medium_size() function the detection of error is a simple test < 0 but for ARM platform, long is 32bits and 2GB = 0x80000000 is seen as error. I solve the issue by changing the prototype fo the function to separate size and result. This patch prepare the next patch with size change to u64. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/dfu/dfu.c')
-rw-r--r--drivers/dfu/dfu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index ceb33e35ee..c77701646b 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -339,9 +339,9 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)
if (dfu->i_buf_start == NULL)
return -ENOMEM;
- dfu->r_left = dfu->get_medium_size(dfu);
- if (dfu->r_left < 0)
- return dfu->r_left;
+ ret = dfu->get_medium_size(dfu, &dfu->r_left);
+ if (ret < 0)
+ return ret;
debug("%s: %s %ld [B]\n", __func__, dfu->name, dfu->r_left);