From: Guillermo Rodriguez Date: Wed, 2 Sep 2020 11:06:06 +0000 (+0200) Subject: dfu: Fix handling of UBI partitions in MTD backend X-Git-Url: http://git.dujemihanovic.xyz/html/static/%7B%7B%20.Permalink%20%7D%7D?a=commitdiff_plain;h=1b3c4cb1e392bf9365ac633d305c6a1aac9b94e1;p=u-boot.git dfu: Fix handling of UBI partitions in MTD backend 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 Reviewed-by: Patrick Delaunay --- diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c index b34975dbb0..ca67585a7e 100644 --- a/drivers/dfu/dfu_mtd.c +++ b/drivers/dfu/dfu_mtd.c @@ -204,7 +204,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; @@ -242,7 +242,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;