Merge git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
[sfrench/cifs-2.6.git] / drivers / pci / setup-bus.c
index 8f7bcf56f1498d17064916d9986433e4e557631b..5ec297d7a5b4c236219a1086c0db63db7d508f56 100644 (file)
 
 #define ROUND_UP(x, a)         (((x) + (a) - 1) & ~((a) - 1))
 
-/*
- * FIXME: IO should be max 256 bytes.  However, since we may
- * have a P2P bridge below a cardbus bridge, we need 4K.
- */
-#define CARDBUS_IO_SIZE                (256)
-#define CARDBUS_MEM_SIZE       (32*1024*1024)
-
-static void __devinit
-pbus_assign_resources_sorted(struct pci_bus *bus)
+static void pbus_assign_resources_sorted(struct pci_bus *bus)
 {
        struct pci_dev *dev;
        struct resource *res;
@@ -227,8 +219,7 @@ pci_setup_bridge(struct pci_bus *bus)
 /* Check whether the bridge supports optional I/O and
    prefetchable memory ranges. If not, the respective
    base/limit registers must be read-only and read as 0. */
-static void __devinit
-pci_bridge_check_ranges(struct pci_bus *bus)
+static void pci_bridge_check_ranges(struct pci_bus *bus)
 {
        u16 io;
        u32 pmem;
@@ -266,8 +257,7 @@ pci_bridge_check_ranges(struct pci_bus *bus)
    bus resource of a given type. Note: we intentionally skip
    the bus resources which have already been assigned (that is,
    have non-NULL parent resource). */
-static struct resource * __devinit
-find_free_bus_resource(struct pci_bus *bus, unsigned long type)
+static struct resource *find_free_bus_resource(struct pci_bus *bus, unsigned long type)
 {
        int i;
        struct resource *r;
@@ -288,8 +278,7 @@ find_free_bus_resource(struct pci_bus *bus, unsigned long type)
    since these windows have 4K granularity and the IO ranges
    of non-bridge PCI devices are limited to 256 bytes.
    We must be careful with the ISA aliasing though. */
-static void __devinit
-pbus_size_io(struct pci_bus *bus)
+static void pbus_size_io(struct pci_bus *bus)
 {
        struct pci_dev *dev;
        struct resource *b_res = find_free_bus_resource(bus, IORESOURCE_IO);
@@ -333,8 +322,7 @@ pbus_size_io(struct pci_bus *bus)
 
 /* Calculate the size of the bus and minimal alignment which
    guarantees that all child resources fit in this size. */
-static int __devinit
-pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long type)
+static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long type)
 {
        struct pci_dev *dev;
        unsigned long min_align, align, size;
@@ -415,12 +403,12 @@ pci_bus_size_cardbus(struct pci_bus *bus)
         * Reserve some resources for CardBus.  We reserve
         * a fixed amount of bus space for CardBus bridges.
         */
-       b_res[0].start = CARDBUS_IO_SIZE;
-       b_res[0].end = b_res[0].start + CARDBUS_IO_SIZE - 1;
+       b_res[0].start = pci_cardbus_io_size;
+       b_res[0].end = b_res[0].start + pci_cardbus_io_size - 1;
        b_res[0].flags |= IORESOURCE_IO;
 
-       b_res[1].start = CARDBUS_IO_SIZE;
-       b_res[1].end = b_res[1].start + CARDBUS_IO_SIZE - 1;
+       b_res[1].start = pci_cardbus_io_size;
+       b_res[1].end = b_res[1].start + pci_cardbus_io_size - 1;
        b_res[1].flags |= IORESOURCE_IO;
 
        /*
@@ -440,22 +428,21 @@ pci_bus_size_cardbus(struct pci_bus *bus)
         * twice the size.
         */
        if (ctrl & PCI_CB_BRIDGE_CTL_PREFETCH_MEM0) {
-               b_res[2].start = CARDBUS_MEM_SIZE;
-               b_res[2].end = b_res[2].start + CARDBUS_MEM_SIZE - 1;
+               b_res[2].start = pci_cardbus_mem_size;
+               b_res[2].end = b_res[2].start + pci_cardbus_mem_size - 1;
                b_res[2].flags |= IORESOURCE_MEM | IORESOURCE_PREFETCH;
 
-               b_res[3].start = CARDBUS_MEM_SIZE;
-               b_res[3].end = b_res[3].start + CARDBUS_MEM_SIZE - 1;
+               b_res[3].start = pci_cardbus_mem_size;
+               b_res[3].end = b_res[3].start + pci_cardbus_mem_size - 1;
                b_res[3].flags |= IORESOURCE_MEM;
        } else {
-               b_res[3].start = CARDBUS_MEM_SIZE * 2;
-               b_res[3].end = b_res[3].start + CARDBUS_MEM_SIZE * 2 - 1;
+               b_res[3].start = pci_cardbus_mem_size * 2;
+               b_res[3].end = b_res[3].start + pci_cardbus_mem_size * 2 - 1;
                b_res[3].flags |= IORESOURCE_MEM;
        }
 }
 
-void __devinit
-pci_bus_size_bridges(struct pci_bus *bus)
+void pci_bus_size_bridges(struct pci_bus *bus)
 {
        struct pci_dev *dev;
        unsigned long mask, prefmask;
@@ -505,8 +492,7 @@ pci_bus_size_bridges(struct pci_bus *bus)
 }
 EXPORT_SYMBOL(pci_bus_size_bridges);
 
-void __devinit
-pci_bus_assign_resources(struct pci_bus *bus)
+void pci_bus_assign_resources(struct pci_bus *bus)
 {
        struct pci_bus *b;
        struct pci_dev *dev;