Skip to content

Commit

Permalink
LoongArch: pci root bridige set acpi companion only when not acpi_dis…
Browse files Browse the repository at this point in the history
…abled.

Fix patch "LoongArch: Add PCI controller support"

Signed-off-by: Tianli Xiong <[email protected]>
Signed-off-by: Yanteng Si <[email protected]>
  • Loading branch information
Yanteng Si committed May 20, 2024
1 parent 570765a commit b398610
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions arch/loongarch/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ void pcibios_add_bus(struct pci_bus *bus)

int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
{
struct acpi_device *adev = NULL;
struct device *bus_dev = &bridge->bus->dev;
struct pci_config_window *cfg = bridge->bus->sysdata;

if (!acpi_disabled)
adev = to_acpi_device(cfg->parent);
if (!acpi_disabled) {
struct acpi_device *adev = NULL;
struct device *bus_dev = &bridge->bus->dev;
struct pci_config_window *cfg = bridge->bus->sysdata;

ACPI_COMPANION_SET(&bridge->dev, adev);
set_dev_node(bus_dev, pa_to_nid(cfg->res.start));
adev = to_acpi_device(cfg->parent);

ACPI_COMPANION_SET(&bridge->dev, adev);
set_dev_node(bus_dev, pa_to_nid(cfg->res.start));
}
return 0;
}

Expand Down

0 comments on commit b398610

Please sign in to comment.