[PATCH 07/15] of: move of_irq_map_pci() into generic code

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Dec 18 08:16:37 EST 2010


On Fri, 2010-12-17 at 16:33 +0100, Sebastian Andrzej Siewior wrote:
> +
> +#if defined(CONFIG_PPC64) || defined(CONFIG_X86)
> +static struct device_node *pci_get_parent_node(struct pci_dev *pdev)
> +{
> +       return pci_bus_to_OF_node(pdev->bus);
> +}
> +#endif
> +
> +#if defined(CONFIG_PPC32) || defined(CONFIG_MICROBLAZE)
> +static struct device_node *pci_get_parent_node(struct pci_dev *pdev)
> +{
> +       struct pci_controller *host;
> +
> +       host = pci_bus_to_host(pdev->bus);
> +       return host ? host->dn : NULL;
> +}
> +#endif
> + 

I'd like it better if instead you added pci_bus_to_OF_node() to ppc32
and microblaze.

The easy way to do so is to do:

	struct pci_controller *host;

	if (bus->self)
		return pci_device_to_OF_node(bus->self);
	host = pci_bus_to_host(pdev->bus);
	return host ? host->dn : NULL;

Cheers,
Ben.




More information about the devicetree-discuss mailing list