fastboot: Improve error reporting on 'getvar partition-{size, type}'
authorEugeniu Rosca <erosca@de.adit-jv.com>
Thu, 28 Mar 2019 13:31:33 +0000 (14:31 +0100)
committerMarek Vasut <marex@denx.de>
Sun, 21 Apr 2019 08:26:51 +0000 (10:26 +0200)
commita40297d74105b3949dc72375e0fdc54fe0b170ad
treeefdf459788e1cf882057410004a13e83d74b1b8d
parent4c829466fcc8c0b5303af6bda21366657b959a30
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>
drivers/fastboot/fb_mmc.c