diff options
-rw-r--r-- | drivers/acpi/pci_root.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 11 | ||||
-rw-r--r-- | include/linux/pci-acpi.h | 4 |
3 files changed, 6 insertions, 11 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index c1c4102e6478..c288ff3c6998 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -51,7 +51,7 @@ static void acpi_pci_root_remove(struct acpi_device *device); | |||
51 | 51 | ||
52 | static int acpi_pci_root_scan_dependent(struct acpi_device *adev) | 52 | static int acpi_pci_root_scan_dependent(struct acpi_device *adev) |
53 | { | 53 | { |
54 | acpiphp_check_host_bridge(adev->handle); | 54 | acpiphp_check_host_bridge(adev); |
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index b7342d2e819b..11a6117fb358 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -382,15 +382,11 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, | |||
382 | return AE_OK; | 382 | return AE_OK; |
383 | } | 383 | } |
384 | 384 | ||
385 | static struct acpiphp_bridge *acpiphp_handle_to_bridge(acpi_handle handle) | 385 | static struct acpiphp_bridge *acpiphp_dev_to_bridge(struct acpi_device *adev) |
386 | { | 386 | { |
387 | struct acpi_device *adev = acpi_bus_get_acpi_device(handle); | ||
388 | struct acpiphp_context *context; | 387 | struct acpiphp_context *context; |
389 | struct acpiphp_bridge *bridge = NULL; | 388 | struct acpiphp_bridge *bridge = NULL; |
390 | 389 | ||
391 | if (!adev) | ||
392 | return NULL; | ||
393 | |||
394 | acpi_lock_hp_context(); | 390 | acpi_lock_hp_context(); |
395 | context = acpiphp_get_context(adev); | 391 | context = acpiphp_get_context(adev); |
396 | if (context) { | 392 | if (context) { |
@@ -401,7 +397,6 @@ static struct acpiphp_bridge *acpiphp_handle_to_bridge(acpi_handle handle) | |||
401 | acpiphp_put_context(context); | 397 | acpiphp_put_context(context); |
402 | } | 398 | } |
403 | acpi_unlock_hp_context(); | 399 | acpi_unlock_hp_context(); |
404 | acpi_bus_put_acpi_device(adev); | ||
405 | return bridge; | 400 | return bridge; |
406 | } | 401 | } |
407 | 402 | ||
@@ -768,11 +763,11 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus) | |||
768 | * ACPI event handlers | 763 | * ACPI event handlers |
769 | */ | 764 | */ |
770 | 765 | ||
771 | void acpiphp_check_host_bridge(acpi_handle handle) | 766 | void acpiphp_check_host_bridge(struct acpi_device *adev) |
772 | { | 767 | { |
773 | struct acpiphp_bridge *bridge; | 768 | struct acpiphp_bridge *bridge; |
774 | 769 | ||
775 | bridge = acpiphp_handle_to_bridge(handle); | 770 | bridge = acpiphp_dev_to_bridge(adev); |
776 | if (bridge) { | 771 | if (bridge) { |
777 | pci_lock_rescan_remove(); | 772 | pci_lock_rescan_remove(); |
778 | 773 | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 5a462c4e5009..637a608ded0b 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -59,12 +59,12 @@ static inline void acpi_pci_slot_remove(struct pci_bus *bus) { } | |||
59 | void acpiphp_init(void); | 59 | void acpiphp_init(void); |
60 | void acpiphp_enumerate_slots(struct pci_bus *bus); | 60 | void acpiphp_enumerate_slots(struct pci_bus *bus); |
61 | void acpiphp_remove_slots(struct pci_bus *bus); | 61 | void acpiphp_remove_slots(struct pci_bus *bus); |
62 | void acpiphp_check_host_bridge(acpi_handle handle); | 62 | void acpiphp_check_host_bridge(struct acpi_device *adev); |
63 | #else | 63 | #else |
64 | static inline void acpiphp_init(void) { } | 64 | static inline void acpiphp_init(void) { } |
65 | static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { } | 65 | static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { } |
66 | static inline void acpiphp_remove_slots(struct pci_bus *bus) { } | 66 | static inline void acpiphp_remove_slots(struct pci_bus *bus) { } |
67 | static inline void acpiphp_check_host_bridge(acpi_handle handle) { } | 67 | static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | #else /* CONFIG_ACPI */ | 70 | #else /* CONFIG_ACPI */ |