diff options
| -rw-r--r-- | drivers/pci/hotplug/pciehprm_acpi.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c index ae244e218620..2bdb30f68bf8 100644 --- a/drivers/pci/hotplug/pciehprm_acpi.c +++ b/drivers/pci/hotplug/pciehprm_acpi.c | |||
| @@ -174,7 +174,9 @@ int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev) | |||
| 174 | acpi_status status; | 174 | acpi_status status; |
| 175 | acpi_handle chandle, handle = DEVICE_ACPI_HANDLE(&(dev->dev)); | 175 | acpi_handle chandle, handle = DEVICE_ACPI_HANDLE(&(dev->dev)); |
| 176 | struct pci_dev *pdev = dev; | 176 | struct pci_dev *pdev = dev; |
| 177 | struct pci_bus *parent; | ||
| 177 | u8 *path_name; | 178 | u8 *path_name; |
| 179 | |||
| 178 | /* | 180 | /* |
| 179 | * Per PCI firmware specification, we should run the ACPI _OSC | 181 | * Per PCI firmware specification, we should run the ACPI _OSC |
| 180 | * method to get control of hotplug hardware before using it. | 182 | * method to get control of hotplug hardware before using it. |
| @@ -190,17 +192,18 @@ int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev) | |||
| 190 | */ | 192 | */ |
| 191 | if (!pdev || !pdev->bus->parent) | 193 | if (!pdev || !pdev->bus->parent) |
| 192 | break; | 194 | break; |
| 195 | parent = pdev->bus->parent; | ||
| 193 | dbg("Could not find %s in acpi namespace, trying parent\n", | 196 | dbg("Could not find %s in acpi namespace, trying parent\n", |
| 194 | pci_name(pdev)); | 197 | pci_name(pdev)); |
| 195 | if (!pdev->bus->parent->self) | 198 | if (!parent->self) |
| 196 | /* Parent must be a host bridge */ | 199 | /* Parent must be a host bridge */ |
| 197 | handle = acpi_get_pci_rootbridge_handle( | 200 | handle = acpi_get_pci_rootbridge_handle( |
| 198 | pci_domain_nr(pdev->bus->parent), | 201 | pci_domain_nr(parent), |
| 199 | pdev->bus->parent->number); | 202 | parent->number); |
| 200 | else | 203 | else |
| 201 | handle = DEVICE_ACPI_HANDLE( | 204 | handle = DEVICE_ACPI_HANDLE( |
| 202 | &(pdev->bus->parent->self->dev)); | 205 | &(parent->self->dev)); |
| 203 | pdev = pdev->bus->parent->self; | 206 | pdev = parent->self; |
| 204 | } | 207 | } |
| 205 | 208 | ||
| 206 | while (handle) { | 209 | while (handle) { |
