]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
expo: Use a simpler name for USB media
authorSimon Glass <sjg@chromium.org>
Fri, 2 May 2025 14:46:47 +0000 (08:46 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 30 May 2025 08:49:32 +0000 (09:49 +0100)
For USB devices we use the string 'usb_mass_storage' which is a bit
verbose. Use 'USB' instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
boot/bootflow_menu.c

index ab21ed84ffdf4f19164760b253ff692d326a0bf5..7b44b6439b638f395e9d0978b30917b96d44b58b 100644 (file)
@@ -84,7 +84,9 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq,
 {
        struct menu_priv *priv = exp->priv;
        char str[2], *label, *key;
+       struct udevice *media;
        struct scene *scn;
+       const char *name;
        uint preview_id;
        uint scene_id;
        bool add_gap;
@@ -101,7 +103,14 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq,
        key = strdup(str);
        if (!key)
                return log_msg_ret("key", -ENOMEM);
-       label = strdup(dev_get_parent(bflow->dev)->name);
+
+       media = dev_get_parent(bflow->dev);
+       if (device_get_uclass_id(media) == UCLASS_MASS_STORAGE)
+               name = "usb";
+       else
+               name = media->name;
+       label = strdup(name);
+
        if (!label) {
                free(key);
                return log_msg_ret("nam", -ENOMEM);