diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_ebda.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/rpaphp_slot.c | 4 | ||||
-rw-r--r-- | drivers/pci/probe.c | 50 | ||||
-rw-r--r-- | drivers/pci/setup-bus.c | 9 |
4 files changed, 10 insertions, 55 deletions
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c index 8467d0287325..7d27631e6e62 100644 --- a/drivers/pci/hotplug/ibmphp_ebda.c +++ b/drivers/pci/hotplug/ibmphp_ebda.c | |||
@@ -276,7 +276,7 @@ int __init ibmphp_access_ebda (void) | |||
276 | iounmap (io_mem); | 276 | iounmap (io_mem); |
277 | debug ("returned ebda segment: %x\n", ebda_seg); | 277 | debug ("returned ebda segment: %x\n", ebda_seg); |
278 | 278 | ||
279 | io_mem = ioremap (ebda_seg<<4, 65000); | 279 | io_mem = ioremap(ebda_seg<<4, 1024); |
280 | if (!io_mem ) | 280 | if (!io_mem ) |
281 | return -ENOMEM; | 281 | return -ENOMEM; |
282 | next_offset = 0x180; | 282 | next_offset = 0x180; |
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c index 9b714ea93d20..50884507b8be 100644 --- a/drivers/pci/hotplug/rpaphp_slot.c +++ b/drivers/pci/hotplug/rpaphp_slot.c | |||
@@ -147,9 +147,5 @@ int rpaphp_register_slot(struct slot *slot) | |||
147 | list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); | 147 | list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); |
148 | info("Slot [%s] registered\n", slot->name); | 148 | info("Slot [%s] registered\n", slot->name); |
149 | return 0; | 149 | return 0; |
150 | |||
151 | sysfs_fail: | ||
152 | pci_hp_deregister(php_slot); | ||
153 | return retval; | ||
154 | } | 150 | } |
155 | 151 | ||
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 36698e57b97f..dd9161a054e1 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -1237,8 +1237,11 @@ EXPORT_SYMBOL(pci_scan_bridge); | |||
1237 | EXPORT_SYMBOL_GPL(pci_scan_child_bus); | 1237 | EXPORT_SYMBOL_GPL(pci_scan_child_bus); |
1238 | #endif | 1238 | #endif |
1239 | 1239 | ||
1240 | static int __init pci_sort_bf_cmp(const struct pci_dev *a, const struct pci_dev *b) | 1240 | static int __init pci_sort_bf_cmp(const struct device *d_a, const struct device *d_b) |
1241 | { | 1241 | { |
1242 | const struct pci_dev *a = to_pci_dev(d_a); | ||
1243 | const struct pci_dev *b = to_pci_dev(d_b); | ||
1244 | |||
1242 | if (pci_domain_nr(a->bus) < pci_domain_nr(b->bus)) return -1; | 1245 | if (pci_domain_nr(a->bus) < pci_domain_nr(b->bus)) return -1; |
1243 | else if (pci_domain_nr(a->bus) > pci_domain_nr(b->bus)) return 1; | 1246 | else if (pci_domain_nr(a->bus) > pci_domain_nr(b->bus)) return 1; |
1244 | 1247 | ||
@@ -1251,50 +1254,7 @@ static int __init pci_sort_bf_cmp(const struct pci_dev *a, const struct pci_dev | |||
1251 | return 0; | 1254 | return 0; |
1252 | } | 1255 | } |
1253 | 1256 | ||
1254 | /* | ||
1255 | * Yes, this forcably breaks the klist abstraction temporarily. It | ||
1256 | * just wants to sort the klist, not change reference counts and | ||
1257 | * take/drop locks rapidly in the process. It does all this while | ||
1258 | * holding the lock for the list, so objects can't otherwise be | ||
1259 | * added/removed while we're swizzling. | ||
1260 | */ | ||
1261 | static void __init pci_insertion_sort_klist(struct pci_dev *a, struct list_head *list) | ||
1262 | { | ||
1263 | struct list_head *pos; | ||
1264 | struct klist_node *n; | ||
1265 | struct device *dev; | ||
1266 | struct pci_dev *b; | ||
1267 | |||
1268 | list_for_each(pos, list) { | ||
1269 | n = container_of(pos, struct klist_node, n_node); | ||
1270 | dev = container_of(n, struct device, knode_bus); | ||
1271 | b = to_pci_dev(dev); | ||
1272 | if (pci_sort_bf_cmp(a, b) <= 0) { | ||
1273 | list_move_tail(&a->dev.knode_bus.n_node, &b->dev.knode_bus.n_node); | ||
1274 | return; | ||
1275 | } | ||
1276 | } | ||
1277 | list_move_tail(&a->dev.knode_bus.n_node, list); | ||
1278 | } | ||
1279 | |||
1280 | void __init pci_sort_breadthfirst(void) | 1257 | void __init pci_sort_breadthfirst(void) |
1281 | { | 1258 | { |
1282 | LIST_HEAD(sorted_devices); | 1259 | bus_sort_breadthfirst(&pci_bus_type, &pci_sort_bf_cmp); |
1283 | struct list_head *pos, *tmp; | ||
1284 | struct klist_node *n; | ||
1285 | struct device *dev; | ||
1286 | struct pci_dev *pdev; | ||
1287 | struct klist *device_klist; | ||
1288 | |||
1289 | device_klist = bus_get_device_klist(&pci_bus_type); | ||
1290 | |||
1291 | spin_lock(&device_klist->k_lock); | ||
1292 | list_for_each_safe(pos, tmp, &device_klist->k_list) { | ||
1293 | n = container_of(pos, struct klist_node, n_node); | ||
1294 | dev = container_of(n, struct device, knode_bus); | ||
1295 | pdev = to_pci_dev(dev); | ||
1296 | pci_insertion_sort_klist(pdev, &sorted_devices); | ||
1297 | } | ||
1298 | list_splice(&sorted_devices, &device_klist->k_list); | ||
1299 | spin_unlock(&device_klist->k_lock); | ||
1300 | } | 1260 | } |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 3abbfad9ddab..d5e2106760f8 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -378,11 +378,10 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, unsigned long | |||
378 | align = 0; | 378 | align = 0; |
379 | min_align = 0; | 379 | min_align = 0; |
380 | for (order = 0; order <= max_order; order++) { | 380 | for (order = 0; order <= max_order; order++) { |
381 | #ifdef CONFIG_RESOURCES_64BIT | 381 | resource_size_t align1 = 1; |
382 | resource_size_t align1 = 1ULL << (order + 20); | 382 | |
383 | #else | 383 | align1 <<= (order + 20); |
384 | resource_size_t align1 = 1U << (order + 20); | 384 | |
385 | #endif | ||
386 | if (!align) | 385 | if (!align) |
387 | min_align = align1; | 386 | min_align = align1; |
388 | else if (ALIGN(align + min_align, min_align) < align1) | 387 | else if (ALIGN(align + min_align, min_align) < align1) |