Merge tag 'pci-v5.14-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[platform/kernel/linux-starfive.git] / drivers / pci / controller / pci-hyperv.c
index 8807b62..a53bd87 100644 (file)
@@ -3464,6 +3464,9 @@ static void __exit exit_hv_pci_drv(void)
 
 static int __init init_hv_pci_drv(void)
 {
+       if (!hv_is_hyperv_initialized())
+               return -ENODEV;
+
        /* Set the invalid domain number's bit, so it will not be used */
        set_bit(HVPCI_DOM_INVALID, hvpci_dom_map);