diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-15 22:03:14 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-07-16 01:45:21 +0200 |
commit | 86f5f3ca49e3d20c1a5e83917b2c8b98a7c95506 (patch) | |
tree | 39cdc562463e0fb96707c5472619bcdade76d568 /drivers/pci | |
parent | Linux 3.16-rc5 (diff) | |
download | linux-86f5f3ca49e3d20c1a5e83917b2c8b98a7c95506.tar.xz linux-86f5f3ca49e3d20c1a5e83917b2c8b98a7c95506.zip |
ACPI / hotplug / PCI: Eliminate acpiphp_dev_to_bridge()
Since acpiphp_dev_to_bridge() is only called by
acpiphp_check_host_bridge(), move the code from it to that function
directly which reduces the call chain depth and makes the code
slightly easier to follow.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 602d153c7055..08043f9c1dd5 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -369,20 +369,6 @@ static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data, return AE_OK; } -static struct acpiphp_bridge *acpiphp_dev_to_bridge(struct acpi_device *adev) -{ - struct acpiphp_bridge *bridge = NULL; - - acpi_lock_hp_context(); - if (adev->hp) { - bridge = to_acpiphp_root_context(adev->hp)->root_bridge; - if (bridge) - get_bridge(bridge); - } - acpi_unlock_hp_context(); - return bridge; -} - static void cleanup_bridge(struct acpiphp_bridge *bridge) { struct acpiphp_slot *slot; @@ -753,9 +739,15 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus) void acpiphp_check_host_bridge(struct acpi_device *adev) { - struct acpiphp_bridge *bridge; + struct acpiphp_bridge *bridge = NULL; - bridge = acpiphp_dev_to_bridge(adev); + acpi_lock_hp_context(); + if (adev->hp) { + bridge = to_acpiphp_root_context(adev->hp)->root_bridge; + if (bridge) + get_bridge(bridge); + } + acpi_unlock_hp_context(); if (bridge) { pci_lock_rescan_remove(); |