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

From: Benjamin Herrenschmidt
Date: Fri Dec 17 2010 - 16:17:17 EST


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.


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