diff options
author | Alex Chiang <achiang@hp.com> | 2009-09-10 14:34:09 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-14 11:46:58 -0400 |
commit | 7f53866932fd08add06ee2f93ead129949158490 (patch) | |
tree | f01520afe3708a3c79233fa67d50124f0dac6335 /drivers/pci/hotplug/pciehp_acpi.c | |
parent | 6edd7679db92376ca54f328d6b0f12291c2dab35 (diff) |
PCI Hotplug: convert acpi_pci_detect_ejectable() to take an acpi_handle
acpi_pci_detect_ejectable() goes through effort to convert its
struct pci_bus arg to an acpi_handle, but every time we use this
interface, we already have the handle available.
So let's just use the handle instead of converting back and forth.
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Tested-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_acpi.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_acpi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c index 96048010e7d9..7163e6a6cfae 100644 --- a/drivers/pci/hotplug/pciehp_acpi.c +++ b/drivers/pci/hotplug/pciehp_acpi.c | |||
@@ -47,7 +47,7 @@ int pciehp_acpi_slot_detection_check(struct pci_dev *dev) | |||
47 | { | 47 | { |
48 | if (slot_detection_mode != PCIEHP_DETECT_ACPI) | 48 | if (slot_detection_mode != PCIEHP_DETECT_ACPI) |
49 | return 0; | 49 | return 0; |
50 | if (acpi_pci_detect_ejectable(dev->subordinate)) | 50 | if (acpi_pci_detect_ejectable(DEVICE_ACPI_HANDLE(&dev->dev))) |
51 | return 0; | 51 | return 0; |
52 | return -ENODEV; | 52 | return -ENODEV; |
53 | } | 53 | } |
@@ -76,9 +76,9 @@ static int __init dummy_probe(struct pcie_device *dev) | |||
76 | { | 76 | { |
77 | int pos; | 77 | int pos; |
78 | u32 slot_cap; | 78 | u32 slot_cap; |
79 | acpi_handle handle; | ||
79 | struct slot *slot, *tmp; | 80 | struct slot *slot, *tmp; |
80 | struct pci_dev *pdev = dev->port; | 81 | struct pci_dev *pdev = dev->port; |
81 | struct pci_bus *pbus = pdev->subordinate; | ||
82 | /* Note: pciehp_detect_mode != PCIEHP_DETECT_ACPI here */ | 82 | /* Note: pciehp_detect_mode != PCIEHP_DETECT_ACPI here */ |
83 | if (pciehp_get_hp_hw_control_from_firmware(pdev)) | 83 | if (pciehp_get_hp_hw_control_from_firmware(pdev)) |
84 | return -ENODEV; | 84 | return -ENODEV; |
@@ -94,7 +94,8 @@ static int __init dummy_probe(struct pcie_device *dev) | |||
94 | dup_slot_id++; | 94 | dup_slot_id++; |
95 | } | 95 | } |
96 | list_add_tail(&slot->slot_list, &dummy_slots); | 96 | list_add_tail(&slot->slot_list, &dummy_slots); |
97 | if (!acpi_slot_detected && acpi_pci_detect_ejectable(pbus)) | 97 | handle = DEVICE_ACPI_HANDLE(&pdev->dev); |
98 | if (!acpi_slot_detected && acpi_pci_detect_ejectable(handle)) | ||
98 | acpi_slot_detected = 1; | 99 | acpi_slot_detected = 1; |
99 | return -ENODEV; /* dummy driver always returns error */ | 100 | return -ENODEV; /* dummy driver always returns error */ |
100 | } | 101 | } |