On 07.08.24 16:36, Simon Glass wrote:
On Tue, 6 Aug 2024 at 18:13, Heinrich Schuchardt
<heinrich.schucha...@canonical.com> wrote:

For SATA devices the class name is 'ahci' but the block device name is
'sata'.

Use function blk_get_uclass_name() to retrieve the correct string.

Signed-off-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
---
  boot/bootmeth_efi.c | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)


Reviewed-by: Simon Glass <s...@chromium.org>

Hmm I suppose I need to do another round to try to get rid of
blk_desc->uclass_id

efi_set_bootdev() should take a udevice in future.

We are converting to string and later back to device before we create a device-path. This makes little sense.

Best regards

Heinrich



diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index 39232eb2e25..6b41c0999f1 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -100,11 +100,10 @@ static void set_efi_bootdev(struct blk_desc *desc, struct 
bootflow *bflow)
         if (last_slash)
                 *last_slash = '\0';

-       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
-                 dev_get_uclass_name(media_dev), devnum_str, bflow->fname,
-                 bflow->buf, size);
         dev_name = device_get_uclass_id(media_dev) == UCLASS_MASS_STORAGE ?
-                "usb" : dev_get_uclass_name(media_dev);
+                "usb" : blk_get_uclass_name(device_get_uclass_id(media_dev));
+       log_debug("setting bootdev %s, %s, %s, %p, %x\n",
+                 dev_name, devnum_str, bflow->fname, bflow->buf, size);
         efi_set_bootdev(dev_name, devnum_str, bflow->fname, bflow->buf, size);
  }

--
2.45.2


Reply via email to