]> git.baikalelectronics.ru Git - uboot.git/commit
dfu: dfu_mtd: remove the mtd_block_op error when mtd_lock is not supported
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 10 Mar 2021 09:27:22 +0000 (10:27 +0100)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Fri, 28 May 2021 09:21:51 +0000 (11:21 +0200)
commit6a2f6ff81e5765c06398c6947d926977843a14cd
treec1b40d86fc8fb47657b6f03d5b19af0ae64edb4c
parent064af46315c7ac24a56b5050de0f30dcd59f466a
dfu: dfu_mtd: remove the mtd_block_op error when mtd_lock is not supported

Fix the result of DFU_OP_WRITE operation in mtd_block_op function
when mtd_lock is not supported (-EOPNOTSUPP) to avoid DFU stack
error on the DFU manifestation of the MTD device, when
dfu_flush_medium_mtd is called.

Without this patch, dfu-util failed on dfuERROR state at the end
of the write operation on the alternate even if MTD write
opeartion is correctly performed.

$> dfu-util -a 3 -D test.bin
....
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from PC to DFU device
....
Download [=========================] 100%       225469 bytes
Download done.
state(10) = dfuERROR, status(14) = Something went wrong,
  but the device does not know what it was Done!

Fixes: 0a62b52392a8 ("dfu_mtd: Add provision to unlock mtd device")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
drivers/dfu/dfu_mtd.c