Thread (50 messages) 50 messages, 5 authors, 2011-02-22

Re: [sodaville] [PATCH TIP 08/14] x86/dtb: add support for PCI devices backed by dtb nodes

From: Sebastian Andrzej Siewior <hidden>
Date: 2011-02-22 11:21:39
Also in: lkml

* Grant Likely | 2011-02-16 14:59:15 [-0700]:
quoted
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
index bd67ab2..3ed0bd6 100644
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -28,8 +29,24 @@ extern void add_dtb(u64 data);
 void x86_dtb_find_config(void);
 void x86_dtb_get_config(unsigned int unused);
 void add_interrupt_host(struct irq_domain *ih);
+void __cpuinit x86_of_pci_init(void);
+
+static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
+{
+       return pdev->dev.of_node;
+}
+
+static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
+{
+       if (bus->self)
+               return pci_device_to_OF_node(bus->self);
+       else
+               return NULL;
+}
Nit: could simply be:

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 pci_device_to_OF_node(bus->self);
}
done.

Sebastian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help