]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ARM64: PCI: Add acpi_pci_bus_find_domain_nr()
authorTomasz Nowicki <tn@semihalf.com>
Fri, 10 Jun 2016 20:36:26 +0000 (15:36 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 10 Jun 2016 23:28:39 +0000 (18:28 -0500)
Extend pci_bus_find_domain_nr() so it can find the domain from either:

  - ACPI, via the new acpi_pci_bus_find_domain_nr() interface, or
  - DT, via of_pci_bus_find_domain_nr()

Note that this is only used for CONFIG_PCI_DOMAINS_GENERIC=y, so it does
not affect x86 or ia64.

[bhelgaas: changelog]
Signed-off-by: Tomasz Nowicki <tn@semihalf.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/arm64/kernel/pci.c
drivers/pci/pci.c
include/linux/pci.h

index 3c4e308b40a0ef53fb0e89303bfe75b3c2f0fb6a..d5d3d26834cf51167ddbb0e66c6994c403e919ad 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/mm.h>
 #include <linux/of_pci.h>
 #include <linux/of_platform.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 
 /*
@@ -85,6 +86,12 @@ EXPORT_SYMBOL(pcibus_to_node);
 #endif
 
 #ifdef CONFIG_ACPI
+
+int acpi_pci_bus_find_domain_nr(struct pci_bus *bus)
+{
+       return 0;
+}
+
 /* Root bridge scanning */
 struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
 {
index 97f7cd4a7e86ce703c122695115818660237d22b..4834ceeca0d27ec97d7560d2c4cd9e1876813f18 100644 (file)
@@ -7,6 +7,7 @@
  *     Copyright 1997 -- 2000 Martin Mares <mj@ucw.cz>
  */
 
+#include <linux/acpi.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -4990,7 +4991,8 @@ static int of_pci_bus_find_domain_nr(struct device *parent)
 
 int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent)
 {
-       return of_pci_bus_find_domain_nr(parent);
+       return acpi_disabled ? of_pci_bus_find_domain_nr(parent) :
+                              acpi_pci_bus_find_domain_nr(bus);
 }
 #endif
 #endif
index 48839e817ef2a7afc4a815154b3e7216ab8c706d..0671e9a840cb8ff08e4c9faf1db2a1b81c15d2ad 100644 (file)
@@ -1390,6 +1390,12 @@ static inline int pci_domain_nr(struct pci_bus *bus)
 {
        return bus->domain_nr;
 }
+#ifdef CONFIG_ACPI
+int acpi_pci_bus_find_domain_nr(struct pci_bus *bus);
+#else
+static inline int acpi_pci_bus_find_domain_nr(struct pci_bus *bus)
+{ return 0; }
+#endif
 int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent);
 #endif