From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guillermo Rodriguez Date: Wed, 2 Sep 2020 13:06:06 +0200 Subject: [PATCH] dfu: Fix handling of UBI partitions in MTD backend Message-ID: <20200902110606.15764-1-guille.rodriguez@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de For UBI partitions ("partubi" in dfu_alt_info), dfu_fill_entity_mtd sets the mtd.ubi flag; however other functions incorrectly check for nand.ubi instead. Fix this by checking for the correct flag. Signed-off-by: Guillermo Rodriguez Cc: Lukasz Majewski --- drivers/dfu/dfu_mtd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c index 36cd4e945b..2811ae8463 100644 --- a/drivers/dfu/dfu_mtd.c +++ b/drivers/dfu/dfu_mtd.c @@ -190,7 +190,7 @@ static int dfu_flush_medium_mtd(struct dfu_entity *dfu) int ret; /* in case of ubi partition, erase rest of the partition */ - if (dfu->data.nand.ubi) { + if (dfu->data.mtd.ubi) { struct erase_info erase_op = {}; erase_op.mtd = dfu->data.mtd.info; @@ -228,7 +228,7 @@ static unsigned int dfu_polltimeout_mtd(struct dfu_entity *dfu) * ubi partition, as sectors which are not used need * to be erased */ - if (dfu->data.nand.ubi) + if (dfu->data.mtd.ubi) return DFU_MANIFEST_POLL_TIMEOUT; return DFU_DEFAULT_POLL_TIMEOUT; -- 2.21.0