diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-12-18 07:29:45 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-12-23 15:51:49 -0500 |
commit | 994e0b2c3646ce0ca0e4546e6b10c5cf66b976bf (patch) | |
tree | 9f93e8f4fc896eb4fc90dd64547e920665fc7d2a | |
parent | e819eb8687767cefca7b6abf5ac6d5efcf581eeb (diff) |
PCI hotplug: Fix unexpected driver unregister in pciehp_acpi.c
If pcie_ports_disabled is set, pcie_port_service_register() returns
error code and select_detection_mode() should not attempt to
unregister dummy_driver and use dummy_slots. It should return
PCIEHP_DETECT_ACPI immediately instead.
Reviewed-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | drivers/pci/hotplug/pciehp_acpi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c index 2574700db461..5f7226223a62 100644 --- a/drivers/pci/hotplug/pciehp_acpi.c +++ b/drivers/pci/hotplug/pciehp_acpi.c | |||
@@ -115,7 +115,8 @@ static struct pcie_port_service_driver __initdata dummy_driver = { | |||
115 | static int __init select_detection_mode(void) | 115 | static int __init select_detection_mode(void) |
116 | { | 116 | { |
117 | struct dummy_slot *slot, *tmp; | 117 | struct dummy_slot *slot, *tmp; |
118 | pcie_port_service_register(&dummy_driver); | 118 | if (pcie_port_service_register(&dummy_driver)) |
119 | return PCIEHP_DETECT_ACPI; | ||
119 | pcie_port_service_unregister(&dummy_driver); | 120 | pcie_port_service_unregister(&dummy_driver); |
120 | list_for_each_entry_safe(slot, tmp, &dummy_slots, list) { | 121 | list_for_each_entry_safe(slot, tmp, &dummy_slots, list) { |
121 | list_del(&slot->list); | 122 | list_del(&slot->list); |