mptable_hostb: Use legacy_get_pcibus() to fetch PCI bus number.

The mptable_hostb driver is a child of legacy0 and has legacy bus
ivars, not PCI or PCI bridge ivars.

PR:		264819
Reported by:	Dennis Clarke <dclarke@blastwave.org>
Diagnosed by:	avg
Reviewed by:	avg
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35548
This commit is contained in:
John Baldwin 2022-06-23 10:49:09 -07:00
parent d1aefbc04c
commit b076d8d54c
2 changed files with 2 additions and 2 deletions

View File

@ -1250,7 +1250,7 @@ mptable_pci_host_res_init(device_t pcib)
struct host_res_args args;
KASSERT(pci0 != -1, ("do not know how to map PCI bus IDs"));
args.bus = pci_get_bus(pcib) + pci0;
args.bus = legacy_get_pcibus(pcib) + pci0;
args.dev = pcib;
args.sc = device_get_softc(pcib);
if (pcib_host_res_init(pcib, &args.sc->sc_host_res) != 0)

View File

@ -57,7 +57,7 @@ mptable_hostb_probe(device_t dev)
if (pci_cfgregopen() == 0)
return (ENXIO);
if (mptable_pci_probe_table(pcib_get_bus(dev)) != 0)
if (mptable_pci_probe_table(legacy_get_pcibus(dev)) != 0)
return (ENXIO);
device_set_desc(dev, "MPTable Host-PCI bridge");
return (0);