Merge tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[linux-drm-fsl-dcu.git] / drivers / pci / host / pci-host-generic.c
index aee3c620ecf98994e6528c0111fd00bf5579030f..ba46e581db99925f9deaf3a392fff4d42d72a8e4 100644 (file)
@@ -76,55 +76,9 @@ static struct gen_pci_cfg_bus_ops gen_pci_cfg_ecam_bus_ops = {
        .map_bus        = gen_pci_map_cfg_bus_ecam,
 };
 
-static int gen_pci_config_read(struct pci_bus *bus, unsigned int devfn,
-                               int where, int size, u32 *val)
-{
-       void __iomem *addr;
-       struct pci_sys_data *sys = bus->sysdata;
-       struct gen_pci *pci = sys->private_data;
-
-       addr = pci->cfg.ops->map_bus(bus, devfn, where);
-
-       switch (size) {
-       case 1:
-               *val = readb(addr);
-               break;
-       case 2:
-               *val = readw(addr);
-               break;
-       default:
-               *val = readl(addr);
-       }
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
-static int gen_pci_config_write(struct pci_bus *bus, unsigned int devfn,
-                                int where, int size, u32 val)
-{
-       void __iomem *addr;
-       struct pci_sys_data *sys = bus->sysdata;
-       struct gen_pci *pci = sys->private_data;
-
-       addr = pci->cfg.ops->map_bus(bus, devfn, where);
-
-       switch (size) {
-       case 1:
-               writeb(val, addr);
-               break;
-       case 2:
-               writew(val, addr);
-               break;
-       default:
-               writel(val, addr);
-       }
-
-       return PCIBIOS_SUCCESSFUL;
-}
-
 static struct pci_ops gen_pci_ops = {
-       .read   = gen_pci_config_read,
-       .write  = gen_pci_config_write,
+       .read   = pci_generic_config_read,
+       .write  = pci_generic_config_write,
 };
 
 static const struct of_device_id gen_pci_of_match[] = {
@@ -287,6 +241,7 @@ static int gen_pci_probe(struct platform_device *pdev)
 
        of_id = of_match_node(gen_pci_of_match, np);
        pci->cfg.ops = of_id->data;
+       gen_pci_ops.map_bus = pci->cfg.ops->map_bus;
        pci->host.dev.parent = dev;
        INIT_LIST_HEAD(&pci->host.windows);
        INIT_LIST_HEAD(&pci->resources);