mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 21:30:43 +00:00
16b84e5a50
Several architectures open code effectively the same code block for finding and mapping PCI irqs. This patch consolidates it down to a single function. Signed-off-by: Grant Likely <grant.likely@linaro.org> Acked-by: Michal Simek <monstr@monstr.eu> Cc: Russell King <linux@arm.linux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
30 lines
751 B
C
30 lines
751 B
C
/*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
* by the Free Software Foundation.
|
|
*
|
|
* Copyright (C) 2012 John Crispin <blogic@openwrt.org>
|
|
*/
|
|
|
|
#include <linux/of_irq.h>
|
|
#include <linux/of_pci.h>
|
|
|
|
int (*ltq_pci_plat_arch_init)(struct pci_dev *dev) = NULL;
|
|
int (*ltq_pci_plat_dev_init)(struct pci_dev *dev) = NULL;
|
|
|
|
int pcibios_plat_dev_init(struct pci_dev *dev)
|
|
{
|
|
if (ltq_pci_plat_arch_init)
|
|
return ltq_pci_plat_arch_init(dev);
|
|
|
|
if (ltq_pci_plat_dev_init)
|
|
return ltq_pci_plat_dev_init(dev);
|
|
|
|
return 0;
|
|
}
|
|
|
|
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
|
|
{
|
|
return of_irq_parse_and_map_pci(dev, slot, pin);
|
|
}
|