Thread (33 messages) 33 messages, 2 authors, 2015-02-26
STALE4110d
Revisions (20)
  1. v1 [diff vs current]
  2. v1 [diff vs current]
  3. v2 [diff vs current]
  4. v2 [diff vs current]
  5. v3 [diff vs current]
  6. v3 current
  7. v4 [diff vs current]
  8. v4 [diff vs current]
  9. v5 [diff vs current]
  10. v5 [diff vs current]
  11. v6 [diff vs current]
  12. v6 [diff vs current]
  13. v7 [diff vs current]
  14. v7 [diff vs current]
  15. v8 [diff vs current]
  16. v8 [diff vs current]
  17. v9 [diff vs current]
  18. v9 [diff vs current]
  19. v10 [diff vs current]
  20. v10 [diff vs current]

[PATCH v3 08/30] PCI: Introduce pci_host_assign_domain_nr() to assign domain

From: Yijing Wang <hidden>
Date: 2015-02-26 01:32:53
Also in: linux-arm-kernel, linux-pci, lkml
Subsystem: pci subsystem, the rest · Maintainers: Bjorn Helgaas, Linus Torvalds

Introduce pci_host_assign_domain_nr() to assign domain
number for pci_host_bridge. Later we will remove
pci_bus_assign_domain_nr().

Signed-off-by: Yijing Wang <redacted>
---
 drivers/pci/pci.c   |   14 +++++++++++---
 include/linux/pci.h |    4 ++++
 2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 81f06e8..d9e7645 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4501,10 +4501,10 @@ int pci_get_new_domain_nr(void)
 }
 
 #ifdef CONFIG_PCI_DOMAINS_GENERIC
-void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent)
+static int pci_assign_domain_nr(struct device *dev)
 {
 	static int use_dt_domains = -1;
-	int domain = of_get_pci_domain_nr(parent->of_node);
+	int domain = of_get_pci_domain_nr(dev->of_node);
 
 	/*
 	 * Check DT domain and use_dt_domains values.
@@ -4542,8 +4542,16 @@ void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent)
 			parent->of_node->full_name);
 		domain = -1;
 	}
+}
 
-	bus->domain_nr = domain;
+void pci_host_assign_domain_nr(struct pci_host_bridge *host)
+{
+	host->domain = pci_assign_domain_nr(host->dev.parent);
+}
+
+void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent)
+{
+	bus->domain_nr = pci_assign_domain_nr(parent);
 }
 #endif
 #endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a11fb55..efd9917 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1327,11 +1327,15 @@ static inline int pci_domain_nr(struct pci_bus *bus)
 	return bus->domain_nr;
 }
 void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent);
+void pci_host_assign_domain_nr(struct pci_host_bridge *host);
 #else
 static inline void pci_bus_assign_domain_nr(struct pci_bus *bus,
 					struct device *parent)
 {
 }
+static inline void pci_host_assign_domain_nr(struct pci_host_bridge *host)
+{
+}
 #endif
 
 /* some architectures require additional setup to direct VGA traffic */
-- 
1.7.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help