Merge commit 'kumar/merge' into merge
[sfrench/cifs-2.6.git] / arch / mn10300 / unit-asb2305 / pci-asb2305.c
index 78cd134ddf7dc19f5c51b4ebd5ce48f8c9d01847..45b40ac6c4647b3bb0751a1352e21e2e0a66ae3e 100644 (file)
  * but we want to try to avoid allocating at 0x2900-0x2bff
  * which might have be mirrored at 0x0100-0x03ff..
  */
-void pcibios_align_resource(void *data, struct resource *res,
-                           resource_size_t size, resource_size_t align)
+resource_size_t pcibios_align_resource(void *data, const struct resource *res,
+                               resource_size_t size, resource_size_t align)
 {
+       resource_size_t start = res->start;
+
 #if 0
        struct pci_dev *dev = data;
 
@@ -47,14 +49,10 @@ void pcibios_align_resource(void *data, struct resource *res,
               );
 #endif
 
-       if (res->flags & IORESOURCE_IO) {
-               unsigned long start = res->start;
+       if ((res->flags & IORESOURCE_IO) && (start & 0x300))
+               start = (start + 0x3ff) & ~0x3ff;
 
-               if (start & 0x300) {
-                       start = (start + 0x3ff) & ~0x3ff;
-                       res->start = start;
-               }
-       }
+       return start;
 }
 
 
@@ -119,6 +117,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
                                         * Invalidate the resource to prevent
                                         * child resource allocations in this
                                         * range. */
+                                       r->start = r->end = 0;
                                        r->flags = 0;
                                }
                        }