boot: Move obtaining the label into a common file
The 'bootflow list' command supports looking at the EFI device-path when available. Move this piece into a common function so it can be used elsewhere. This updates the output from 'bootflow list'. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -70,21 +70,7 @@ static void report_bootflow_err(struct bootflow *bflow, int err)
|
||||
*/
|
||||
static void show_bootflow(int index, struct bootflow *bflow, bool errors)
|
||||
{
|
||||
const char *name = NULL;
|
||||
|
||||
if (IS_ENABLED(CONFIG_EFI_APP)) {
|
||||
struct efi_device_path *dp;
|
||||
enum uclass_id id;
|
||||
int ret;
|
||||
|
||||
ret = efi_dp_from_bootflow(bflow, &dp, NULL);
|
||||
if (!ret)
|
||||
name = efi_dp_guess_uclass(dp, &id);
|
||||
} else if (bflow->dev) {
|
||||
name = dev_get_uclass_name(dev_get_parent(bflow->dev));
|
||||
}
|
||||
if (!name)
|
||||
name = "(none)";
|
||||
const char *name = bootflow_guess_label(bflow);
|
||||
|
||||
printf("%3x %-11s %-6s %-9.9s %4x %-25.25s %s\n", index,
|
||||
bflow->method ? bflow->method->name : "(none)",
|
||||
|
||||
Reference in New Issue
Block a user