]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/sysdev/tsi108_pci.c
[POWERPC] tsi108_direct_pci_ops: Use named structure member initializers
[linux-2.6-omap-h63xx.git] / arch / powerpc / sysdev / tsi108_pci.c
index 58b9e7f8abf276b51406b0ddf421f6a0bd415836..cf0bfbd7340189629bb640b1efeecc60b2862cea 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/machdep.h>
 #include <asm/pci-bridge.h>
 #include <asm/tsi108.h>
+#include <asm/tsi108_pci.h>
 #include <asm/tsi108_irq.h>
 #include <asm/prom.h>
 
@@ -49,6 +50,7 @@
        ((((bus)<<16) | ((devfunc)<<8) | (offset & 0xfc)) + tsi108_pci_cfg_base)
 
 u32 tsi108_pci_cfg_base;
+static u32 tsi108_pci_cfg_phys;
 u32 tsi108_csr_vir_base;
 static struct device_node *pci_irq_node;
 static struct irq_host *pci_irq_host;
@@ -62,9 +64,10 @@ tsi108_direct_write_config(struct pci_bus *bus, unsigned int devfunc,
                           int offset, int len, u32 val)
 {
        volatile unsigned char *cfg_addr;
+       struct pci_controller *hose = bus->sysdata;
 
        if (ppc_md.pci_exclude_device)
-               if (ppc_md.pci_exclude_device(bus->number, devfunc))
+               if (ppc_md.pci_exclude_device(hose, bus->number, devfunc))
                        return PCIBIOS_DEVICE_NOT_FOUND;
 
        cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number,
@@ -147,10 +150,11 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
                          int len, u32 * val)
 {
        volatile unsigned char *cfg_addr;
+       struct pci_controller *hose = bus->sysdata;
        u32 temp;
 
        if (ppc_md.pci_exclude_device)
-               if (ppc_md.pci_exclude_device(bus->number, devfn))
+               if (ppc_md.pci_exclude_device(hose, bus->number, devfn))
                        return PCIBIOS_DEVICE_NOT_FOUND;
 
        cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number,
@@ -185,25 +189,25 @@ tsi108_direct_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 
 void tsi108_clear_pci_cfg_error(void)
 {
-       tsi108_clear_pci_error(TSI108_PCI_CFG_BASE_PHYS);
+       tsi108_clear_pci_error(tsi108_pci_cfg_phys);
 }
 
 static struct pci_ops tsi108_direct_pci_ops = {
-       tsi108_direct_read_config,
-       tsi108_direct_write_config
+       .read = tsi108_direct_read_config,
+       .write = tsi108_direct_write_config,
 };
 
-int __init tsi108_setup_pci(struct device_node *dev)
+int __init tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary)
 {
        int len;
        struct pci_controller *hose;
        struct resource rsrc;
        const int *bus_range;
-       int primary = 0, has_address = 0;
+       int has_address = 0;
 
        /* PCI Config mapping */
-       tsi108_pci_cfg_base = (u32)ioremap(TSI108_PCI_CFG_BASE_PHYS,
-                       TSI108_PCI_CFG_SIZE);
+       tsi108_pci_cfg_base = (u32)ioremap(cfg_phys, TSI108_PCI_CFG_SIZE);
+       tsi108_pci_cfg_phys = cfg_phys;
        DBG("TSI_PCI: %s tsi108_pci_cfg_base=0x%x\n", __FUNCTION__,
            tsi108_pci_cfg_base);
 
@@ -217,14 +221,12 @@ int __init tsi108_setup_pci(struct device_node *dev)
                       " bus 0\n", dev->full_name);
        }
 
-       hose = pcibios_alloc_controller();
+       hose = pcibios_alloc_controller(dev);
 
        if (!hose) {
                printk("PCI Host bridge init failed\n");
                return -ENOMEM;
        }
-       hose->arch_data = dev;
-       hose->set_cfg_type = 1;
 
        hose->first_busno = bus_range ? bus_range[0] : 0;
        hose->last_busno = bus_range ? bus_range[1] : 0xff;