lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Apr 2011 14:12:50 +1000
From:	Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:	linux-pci@...r.kernel.org
Cc:	linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
	davem@...emloft.net, bheglaas@...gle.com, monstr@...str.eu,
	tglx@...utronix.de, bigeasy@...utronix.de,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: [PATCH 6/6] pci/of: Consolidate pci_bus_to_OF_node()

The generic code always get the device-node in the right place now
so a single implementation will work for all archs

Signed-off-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
---
 arch/microblaze/include/asm/pci-bridge.h |    5 -----
 arch/powerpc/include/asm/pci-bridge.h    |    5 -----
 arch/x86/include/asm/prom.h              |    6 ------
 include/linux/pci.h                      |    5 +++++
 4 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/arch/microblaze/include/asm/pci-bridge.h b/arch/microblaze/include/asm/pci-bridge.h
index 0d74d03..242be57 100644
--- a/arch/microblaze/include/asm/pci-bridge.h
+++ b/arch/microblaze/include/asm/pci-bridge.h
@@ -102,11 +102,6 @@ struct pci_controller {
 };
 
 #ifdef CONFIG_PCI
-static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
-{
-	return bus->dev.of_node;
-}
-
 static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
 {
 	return bus->sysdata;
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 578060e..90bd3ed 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -169,11 +169,6 @@ static inline struct pci_controller *pci_bus_to_host(const struct pci_bus *bus)
 	return bus->sysdata;
 }
 
-static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
-{
-	return bus->dev.of_node;
-}
-
 #ifndef CONFIG_PPC64
 
 extern int pci_device_from_OF_node(struct device_node *node,
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
index dd6066a..df12870 100644
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -30,12 +30,6 @@ extern void add_dtb(u64 data);
 extern void x86_add_irq_domains(void);
 void __cpuinit x86_of_pci_init(void);
 void x86_dtb_init(void);
-
-static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
-{
-	return pci_device_to_OF_node(bus->self);
-}
-
 #else
 static inline void add_dtb(u64 data) { }
 static inline void x86_add_irq_domains(void) { }
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 73dab8a..532c4e8 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1559,6 +1559,11 @@ static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
 	return pdev ? pdev->dev.of_node : NULL;
 }
 
+static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
+{
+	return bus ? bus->dev.of_node : NULL;
+}
+
 #else /* CONFIG_OF */
 static inline void pci_set_of_node(struct pci_dev *dev) { }
 static inline void pci_release_of_node(struct pci_dev *dev) { }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ