[libata] license change, other bits
[safe/jmp/linux-2.6] / drivers / pci / bus.c
index dbd3360..fb9a112 100644 (file)
@@ -60,7 +60,9 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
                        continue;
 
                /* Ok, try it out.. */
-               ret = allocate_resource(r, res, size, min, -1, align,
+               ret = allocate_resource(r, res, size,
+                                       r->start ? : min,
+                                       -1, align,
                                        alignf, alignf_data);
                if (ret == 0)
                        break;
@@ -121,10 +123,13 @@ void __devinit pci_bus_add_devices(struct pci_bus *bus)
                 * If there is an unattached subordinate bus, attach
                 * it and then scan for unattached PCI devices.
                 */
-               if (dev->subordinate && list_empty(&dev->subordinate->node)) {
-                       spin_lock(&pci_bus_lock);
-                       list_add_tail(&dev->subordinate->node, &dev->bus->children);
-                       spin_unlock(&pci_bus_lock);
+               if (dev->subordinate) {
+                      if (list_empty(&dev->subordinate->node)) {
+                              spin_lock(&pci_bus_lock);
+                              list_add_tail(&dev->subordinate->node,
+                                              &dev->bus->children);
+                              spin_unlock(&pci_bus_lock);
+                      }
                        pci_bus_add_devices(dev->subordinate);
 
                        sysfs_create_link(&dev->subordinate->class_dev.kobj, &dev->dev.kobj, "bridge");