]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
virtio: Ensure PCI is set up first
authorSimon Glass <sjg@chromium.org>
Mon, 24 Apr 2023 01:49:45 +0000 (13:49 +1200)
committerTom Rini <trini@konsulko.com>
Wed, 26 Apr 2023 12:43:04 +0000 (08:43 -0400)
Sometimes virtio may rely on PCI, or at least that is what the
distro_bootcmd script suggests. Add this in.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/virtio/virtio-uclass.c

index b3fb3dbfad2883c5a147bae0c266aa97e1df0e54..31bb21c534e5358b62155fa976d418dcc75a0ddd 100644 (file)
@@ -373,6 +373,12 @@ static int virtio_bootdev_hunt(struct bootdev_hunter *info, bool show)
 {
        int ret;
 
+       if (IS_ENABLED(CONFIG_PCI)) {
+               ret = uclass_probe_all(UCLASS_PCI);
+               if (ret && ret != -ENOENT)
+                       return log_msg_ret("pci", ret);
+       }
+
        ret = uclass_probe_all(UCLASS_VIRTIO);
        if (ret && ret != -ENOENT)
                return log_msg_ret("vir", ret);