diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-22 23:32:50 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-22 23:32:50 +0200 |
commit | 0f6662a49bf1b5a163ed4e6321c382d2390c817b (patch) | |
tree | f52d6d047c37ce78af25a0db7e4f54737d023fe4 /drivers/pci/hotplug/acpiphp_glue.c | |
parent | Merge branch 'topic/fixes-for-3.5' into next (diff) | |
parent | PCI: remove useless pcix_set_mmrbc() dev->bus check (diff) | |
download | linux-0f6662a49bf1b5a163ed4e6321c382d2390c817b.tar.xz linux-0f6662a49bf1b5a163ed4e6321c382d2390c817b.zip |
Merge branch 'topic/bjorn-trivial' into next
* topic/bjorn-trivial:
PCI: remove useless pcix_set_mmrbc() dev->bus check
PCI: acpiphp: check whether _ADR evaluation succeeded
PCI: shpchp: remove dead code
PCI: fix P2P bridge I/O port window sign extension
PCI: fix upstream P2P bridge checks when enabling OBFF and LTR
PCI: use __weak consistently
PCI: cleanup assign_requested_resources_sorted() kernel-doc warning
sparc/PCI: remove unused pcibios_assign_resource() definition
Diffstat (limited to 'drivers/pci/hotplug/acpiphp_glue.c')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 73af3374e915..395c67d3d296 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -132,6 +132,15 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) if (!acpi_pci_check_ejectable(pbus, handle) && !is_dock_device(handle)) return AE_OK; + status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); + if (ACPI_FAILURE(status)) { + warn("can't evaluate _ADR (%#x)\n", status); + return AE_OK; + } + + device = (adr >> 16) & 0xffff; + function = adr & 0xffff; + pdev = pbus->self; if (pdev && pci_is_pcie(pdev)) { tmp = acpi_find_root_bridge_handle(pdev); @@ -144,10 +153,6 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) } } - acpi_evaluate_integer(handle, "_ADR", NULL, &adr); - device = (adr >> 16) & 0xffff; - function = adr & 0xffff; - newfunc = kzalloc(sizeof(struct acpiphp_func), GFP_KERNEL); if (!newfunc) return AE_NO_MEMORY; |