aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorAlexander Chiang <achiang@hp.com>2009-06-10 15:55:50 -0400
committerLen Brown <len.brown@intel.com>2009-06-17 23:32:00 -0400
commitd6aa484c1c0cd39ff3a42f4050b55d2a5b285ef5 (patch)
tree0ed1b14e195fcdf460c2ab64893a8105495cc262 /drivers/pci/hotplug
parent97719a8726fe8d3ea12a85fbf4f514a915ba30ec (diff)
PCI Hotplug: acpiphp: convert to acpi_get_pci_dev
Now that acpi_get_pci_dev is available, let's use it instead of acpi_get_pci_id. Signed-off-by: Alex Chiang <achiang@hp.com> Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index fc6636e3300b..0cb0f830a993 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -678,18 +678,9 @@ static void remove_bridge(acpi_handle handle)
678 678
679static struct pci_dev * get_apic_pci_info(acpi_handle handle) 679static struct pci_dev * get_apic_pci_info(acpi_handle handle)
680{ 680{
681 struct acpi_pci_id id;
682 struct pci_bus *bus;
683 struct pci_dev *dev; 681 struct pci_dev *dev;
684 682
685 if (ACPI_FAILURE(acpi_get_pci_id(handle, &id))) 683 dev = acpi_get_pci_dev(handle);
686 return NULL;
687
688 bus = pci_find_bus(id.segment, id.bus);
689 if (!bus)
690 return NULL;
691
692 dev = pci_get_slot(bus, PCI_DEVFN(id.device, id.function));
693 if (!dev) 684 if (!dev)
694 return NULL; 685 return NULL;
695 686
@@ -1396,19 +1387,16 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus)
1396/* Program resources in newly inserted bridge */ 1387/* Program resources in newly inserted bridge */
1397static int acpiphp_configure_bridge (acpi_handle handle) 1388static int acpiphp_configure_bridge (acpi_handle handle)
1398{ 1389{
1399 struct acpi_pci_id pci_id; 1390 struct pci_dev *dev;
1400 struct pci_bus *bus; 1391 struct pci_bus *bus;
1401 1392
1402 if (ACPI_FAILURE(acpi_get_pci_id(handle, &pci_id))) { 1393 dev = acpi_get_pci_dev(handle);
1394 if (!dev) {
1403 err("cannot get PCI domain and bus number for bridge\n"); 1395 err("cannot get PCI domain and bus number for bridge\n");
1404 return -EINVAL; 1396 return -EINVAL;
1405 } 1397 }
1406 bus = pci_find_bus(pci_id.segment, pci_id.bus); 1398
1407 if (!bus) { 1399 bus = dev->bus;
1408 err("cannot find bus %d:%d\n",
1409 pci_id.segment, pci_id.bus);
1410 return -EINVAL;
1411 }
1412 1400
1413 pci_bus_size_bridges(bus); 1401 pci_bus_size_bridges(bus);
1414 pci_bus_assign_resources(bus); 1402 pci_bus_assign_resources(bus);
@@ -1416,6 +1404,7 @@ static int acpiphp_configure_bridge (acpi_handle handle)
1416 acpiphp_set_hpp_values(handle, bus); 1404 acpiphp_set_hpp_values(handle, bus);
1417 pci_enable_bridges(bus); 1405 pci_enable_bridges(bus);
1418 acpiphp_configure_ioapics(handle); 1406 acpiphp_configure_ioapics(handle);
1407 pci_dev_put(dev);
1419 return 0; 1408 return 0;
1420} 1409}
1421 1410