diff options
Diffstat (limited to 'drivers/dfu/dfu_ram.c')
-rw-r--r-- | drivers/dfu/dfu_ram.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/dfu/dfu_ram.c b/drivers/dfu/dfu_ram.c index 335a8e1..b6c6e60 100644 --- a/drivers/dfu/dfu_ram.c +++ b/drivers/dfu/dfu_ram.c @@ -41,14 +41,14 @@ static int dfu_write_medium_ram(struct dfu_entity *dfu, u64 offset, return dfu_transfer_medium_ram(DFU_OP_WRITE, dfu, offset, buf, len); } +long dfu_get_medium_size_ram(struct dfu_entity *dfu) +{ + return dfu->data.ram.size; +} + static int dfu_read_medium_ram(struct dfu_entity *dfu, u64 offset, void *buf, long *len) { - if (!*len) { - *len = dfu->data.ram.size; - return 0; - } - return dfu_transfer_medium_ram(DFU_OP_READ, dfu, offset, buf, len); } @@ -69,6 +69,7 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s) dfu->data.ram.size = simple_strtoul(s, &s, 16); dfu->write_medium = dfu_write_medium_ram; + dfu->get_medium_size = dfu_get_medium_size_ram; dfu->read_medium = dfu_read_medium_ram; dfu->inited = 0; |