[PATCH] [RFC] i386/i386_mainbus: fix the build when MPBIOS and ACPI are disabled

Paolo Pisati <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
In sys/arch/i386/i386/i386_mainbus.c::i386_mainbus_rescan() mp_pci_scan() is
only executed if:

...
                if (npcibus == 0 && mpacpi_active)
                        npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint);
                if (npcibus == 0 && mpbios_scanned != 0)
                        npcibus = mp_pci_scan(self, &mba.mba_pba, pcibusprint);
...

hence follow the same condition during the unwind.

Signed-off-by: Paolo Pisati <[email protected]>
---
 sys/arch/i386/i386/i386_mainbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arch/i386/i386/i386_mainbus.c b/sys/arch/i386/i386/i386_mainbus.c
index f6d2f24a593a..2834002e5989 100644
--- a/sys/arch/i386/i386/i386_mainbus.c
+++ b/sys/arch/i386/i386/i386_mainbus.c
@@ -178,7 +178,7 @@ i386_mainbus_childdetached(device_t self, device_t child)
 	if (sc->sc_pci == child)
 		sc->sc_pci = NULL;
 
-#if NPCI > 0
+#if NPCI > 0 && (defined(ACPI_SCANPCI) || defined(MPBIOS_SCANPCI))
 	mp_pci_childdetached(self, child);
 #endif
 }
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.