diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 7c08feb04e..cd6eef64fa 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -681,6 +681,8 @@ static void pci_setup_device(FAR struct pci_device_s *dev, int max_bar, pci_read_config_byte(dev, PCI_COMMAND, &cmd); pci_write_config_byte(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY); +#else + uint32_t tmp; #endif for (bar = 0; bar < max_bar; bar++) @@ -754,8 +756,6 @@ static void pci_setup_device(FAR struct pci_device_s *dev, int max_bar, res->start += size; #else UNUSED(res); - uint32_t tmp; - pci_read_config_dword(dev, base_address_0, &tmp); if (mask & PCI_BASE_ADDRESS_SPACE_IO) { @@ -1032,7 +1032,7 @@ static void pci_scan_bus(FAR struct pci_bus_s *bus) child_bus->parent_bus = bus; #ifdef CONFIG_PCI_ASSIGN_ALL_BUSES - child_bus->number = ctrl->busno++; + child_bus->number = bus->ctrl->busno++; #endif list_add_tail(&bus->children, &child_bus->node);