summaryrefslogtreecommitdiff
path: root/drivers/dfu
diff options
context:
space:
mode:
authorPatrick Delaunay <[email protected]>2023-06-05 09:52:07 +0200
committerDario Binacchi <[email protected]>2023-10-13 10:49:07 +0200
commit4b1c067ea78f01fb5b79fa4e6589f750b330c592 (patch)
tree957c33b9f8da9240820d63bbcca9c0892f4f5fce /drivers/dfu
parent1174a2ffa06f87eab5368b7b17119c8a157ac8f0 (diff)
dfu: mtd: fix the trace when limit is reached
The offset variable = 'off' used in the error trace when limit is reach on erase operation is incorect as 'erase_op.addr' is used in the loop. This patch corrects the copy paste issue between the erase loop and the write loop. This patch also adds the 'remaining' information to allow to debug of limit issues. Fixes: 6015af28ee6d ("dfu: add backend for MTD device") Signed-off-by: Patrick Delaunay <[email protected]> Reviewed-by: Patrice Chotard <[email protected]>
Diffstat (limited to 'drivers/dfu')
-rw-r--r--drivers/dfu/dfu_mtd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
index 75e2f6a4215..50d6b17cefa 100644
--- a/drivers/dfu/dfu_mtd.c
+++ b/drivers/dfu/dfu_mtd.c
@@ -85,8 +85,8 @@ static int mtd_block_op(enum dfu_op op, struct dfu_entity *dfu,
while (remaining) {
if (erase_op.addr + remaining > lim) {
- printf("Limit reached 0x%llx while erasing at offset 0x%llx\n",
- lim, off);
+ printf("Limit reached 0x%llx while erasing at offset 0x%llx, remaining 0x%llx\n",
+ lim, erase_op.addr, remaining);
return -EIO;
}