diff options
author | Eugeniu Rosca <erosca@de.adit-jv.com> | 2019-03-28 14:31:33 +0100 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2019-04-21 10:26:51 +0200 |
commit | a40297d74105b3949dc72375e0fdc54fe0b170ad (patch) | |
tree | efdf459788e1cf882057410004a13e83d74b1b8d /drivers/fastboot | |
parent | 4c829466fcc8c0b5303af6bda21366657b959a30 (diff) | |
download | u-boot-a40297d74105b3949dc72375e0fdc54fe0b170ad.tar.gz u-boot-a40297d74105b3949dc72375e0fdc54fe0b170ad.tar.bz2 u-boot-a40297d74105b3949dc72375e0fdc54fe0b170ad.zip |
fastboot: Improve error reporting on 'getvar partition-{size, type}'
Currently U-Boot reports the same error message in all below cases:
[A] host> fastboot getvar partition-type
[B] host> fastboot getvar partition-size
[C] host> fastboot getvar partition-type:
[D] host> fastboot getvar partition-size:
[E] host> fastboot getvar partition-type:<invalid-part>
[F] host> fastboot getvar partition-size:<invalid-part>
The message looks like:
host> fastboot getvar partition-size:
getvar:partition-size: FAILED (remote: partition not found)
Finished. Total time: 0.003s
Be more user friendly and output:
- "partition not given" for [A-D]
- "partition not found" for [E-F]
Fixes: f73a7df984a9 ("net: fastboot: Merge AOSP UDP fastboot")
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Acked-by: Alex Kiernan <alex.kiernan@gmail.com>
Diffstat (limited to 'drivers/fastboot')
-rw-r--r-- | drivers/fastboot/fb_mmc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c index 4c1c7fd2cd..d04d8a448c 100644 --- a/drivers/fastboot/fb_mmc.c +++ b/drivers/fastboot/fb_mmc.c @@ -308,8 +308,8 @@ int fastboot_mmc_get_part_info(char *part_name, struct blk_desc **dev_desc, fastboot_fail("block device not found", response); return -ENOENT; } - if (!part_name) { - fastboot_fail("partition not found", response); + if (!part_name || !strcmp(part_name, "")) { + fastboot_fail("partition not given", response); return -ENOENT; } |