diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2017-07-19 16:39:22 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2017-07-28 23:34:38 +0200 |
commit | 4de512018ba7d57f1672be21c7459281f7c97514 (patch) | |
tree | ca142a43fc4dde3780e35568eedbbe26dbeec39c /drivers/dfu/dfu_sf.c | |
parent | bab0146ea91146aafa8cf10a34a45ae85eca5683 (diff) | |
download | u-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_sf.c')
-rw-r--r-- | drivers/dfu/dfu_sf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c index b6d5fe24dc..2b26f2c608 100644 --- a/drivers/dfu/dfu_sf.c +++ b/drivers/dfu/dfu_sf.c @@ -12,9 +12,11 @@ #include <spi.h> #include <spi_flash.h> -static long dfu_get_medium_size_sf(struct dfu_entity *dfu) +static int dfu_get_medium_size_sf(struct dfu_entity *dfu, long *size) { - return dfu->data.sf.size; + *size = dfu->data.sf.size; + + return 0; } static int dfu_read_medium_sf(struct dfu_entity *dfu, u64 offset, void *buf, |