summaryrefslogtreecommitdiff
path: root/drivers/fastboot
diff options
context:
space:
mode:
authorGary Bisson <gary.bisson@boundarydevices.com>2020-08-27 11:51:14 +0300
committerMarek Vasut <marex@denx.de>2020-09-01 15:47:43 +0300
commit293a6dfeb96129abebf1ad927fa9aedf03a66d34 (patch)
treee3ff28a24447b39d509a142ce126f2da6a39d153 /drivers/fastboot
parent64af06ce91d1b2f7819a273e56f7c41186a7588b (diff)
downloadu-boot-293a6dfeb96129abebf1ad927fa9aedf03a66d34.tar.xz
fastboot: getvar: fix partition-size return value
The size returned by 'getvar partition-size' should be in bytes, not in blocks as fastboot uses that value to generate empty partition when running format [1]. Note that the function was already returning the proper size in bytes for NAND devices (see struct part_info details). [1] https://android.googlesource.com/platform/system/core/+/refs/heads/android10-release/fastboot/fastboot.cpp#1500 Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Diffstat (limited to 'drivers/fastboot')
-rw-r--r--drivers/fastboot/fb_getvar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index 52da34b1e3..d43f2cfee6 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -95,7 +95,7 @@ static const struct {
*
* @param[in] part_name Info for which partition name to look for
* @param[in,out] response Pointer to fastboot response buffer
- * @param[out] size If not NULL, will contain partition size (in blocks)
+ * @param[out] size If not NULL, will contain partition size
* @return Partition number or negative value on error
*/
static int getvar_get_part_info(const char *part_name, char *response,
@@ -109,7 +109,7 @@ static int getvar_get_part_info(const char *part_name, char *response,
r = fastboot_mmc_get_part_info(part_name, &dev_desc, &part_info,
response);
if (r >= 0 && size)
- *size = part_info.size;
+ *size = part_info.size * part_info.blksz;
# elif CONFIG_IS_ENABLED(FASTBOOT_FLASH_NAND)
struct part_info *part_info;