diff options
| -rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index d36732cd4bad..712f02fb1cbb 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
| @@ -1105,6 +1105,16 @@ static int enable_device(struct acpiphp_slot *slot) | |||
| 1105 | return retval; | 1105 | return retval; |
| 1106 | } | 1106 | } |
| 1107 | 1107 | ||
| 1108 | static void disable_bridges(struct pci_bus *bus) | ||
| 1109 | { | ||
| 1110 | struct pci_dev *dev; | ||
| 1111 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
| 1112 | if (dev->subordinate) { | ||
| 1113 | disable_bridges(dev->subordinate); | ||
| 1114 | pci_disable_device(dev); | ||
| 1115 | } | ||
| 1116 | } | ||
| 1117 | } | ||
| 1108 | 1118 | ||
| 1109 | /** | 1119 | /** |
| 1110 | * disable_device - disable a slot | 1120 | * disable_device - disable a slot |
| @@ -1129,8 +1139,13 @@ static int disable_device(struct acpiphp_slot *slot) | |||
| 1129 | func->bridge = NULL; | 1139 | func->bridge = NULL; |
| 1130 | } | 1140 | } |
| 1131 | 1141 | ||
| 1132 | if (func->pci_dev) | 1142 | if (func->pci_dev) { |
| 1133 | pci_stop_bus_device(func->pci_dev); | 1143 | pci_stop_bus_device(func->pci_dev); |
| 1144 | if (func->pci_dev->subordinate) { | ||
| 1145 | disable_bridges(func->pci_dev->subordinate); | ||
| 1146 | pci_disable_device(func->pci_dev); | ||
| 1147 | } | ||
| 1148 | } | ||
| 1134 | 1149 | ||
| 1135 | acpiphp_bus_trim(func->handle); | 1150 | acpiphp_bus_trim(func->handle); |
| 1136 | /* try to remove anyway. | 1151 | /* try to remove anyway. |
