diff mbox series

[v3,12/14] dfu_mtd: Ignore non-implemented lock device failure

Message ID 162062838237.501222.11456115358325982186.stgit@localhost
State Superseded
Headers show
Series arm64: synquacer: Add SynQuacer/DeveloperBox support | expand

Commit Message

Masami Hiramatsu May 10, 2021, 6:33 a.m. UTC
Ignore the non-implemented lock device failure on writing mtd
via DFU. Without this fix, DFU write shows an error on such device
even if it succeeded, because dfu->write_medium returns -EOPNOTSUPP.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>

Cc: Lukasz Majewski <lukma@denx.de>
---
 drivers/dfu/dfu_mtd.c |    2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
index ca67585a7e..e58302c32d 100644
--- a/drivers/dfu/dfu_mtd.c
+++ b/drivers/dfu/dfu_mtd.c
@@ -152,6 +152,8 @@  static int mtd_block_op(enum dfu_op op, struct dfu_entity *dfu,
 		ret = mtd_lock(mtd, lock_ofs, lock_len);
 		if (ret && ret != -EOPNOTSUPP)
 			printf("MTD device lock failed\n");
+		if (ret == -EOPNOTSUPP)
+			ret = 0;
 	}
 	return ret;
 }