Message ID | 1640764674-7784-1-git-send-email-ani@anirban.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | acpihp: simplify acpi_pcihp_disable_root_bus | expand |
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 30405b5113..e497f66ff6 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -128,20 +128,15 @@ static void acpi_set_pci_info(void) static void acpi_pcihp_disable_root_bus(void) { - static bool root_hp_disabled; Object *host = acpi_get_i386_pci_host(); PCIBus *bus; - if (root_hp_disabled) { - return; - } - bus = PCI_HOST_BRIDGE(host)->bus; - if (bus) { + if (bus && qbus_is_hotpluggable(BUS(bus))) { /* setting the hotplug handler to NULL makes the bus non-hotpluggable */ qbus_set_hotplug_handler(BUS(bus), NULL); } - root_hp_disabled = true; + return; }