[sodaville] [PATCH TIP 08/14] x86/dtb: add support for PCI devices backed by dtb nodes
Sebastian Andrzej Siewior
bigeasy at linutronix.de
Tue Feb 22 22:21:23 EST 2011
* Grant Likely | 2011-02-16 14:59:15 [-0700]:
>> 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
More information about the devicetree-discuss
mailing list