diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/acpi_pcihp.c | 7 | ||||
-rw-r--r-- | drivers/pci/hotplug/acpiphp_glue.c | 8 | ||||
-rw-r--r-- | drivers/pci/pci-acpi.c | 3 | ||||
-rw-r--r-- | drivers/pci/pci.c | 8 |
4 files changed, 15 insertions, 11 deletions
diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index 2a47e82821da..5440131cd4ee 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c | |||
@@ -411,13 +411,10 @@ EXPORT_SYMBOL(acpi_get_hp_hw_control_from_firmware); | |||
411 | static int pcihp_is_ejectable(acpi_handle handle) | 411 | static int pcihp_is_ejectable(acpi_handle handle) |
412 | { | 412 | { |
413 | acpi_status status; | 413 | acpi_status status; |
414 | acpi_handle tmp; | ||
415 | unsigned long long removable; | 414 | unsigned long long removable; |
416 | status = acpi_get_handle(handle, "_ADR", &tmp); | 415 | if (!acpi_has_method(handle, "_ADR")) |
417 | if (ACPI_FAILURE(status)) | ||
418 | return 0; | 416 | return 0; |
419 | status = acpi_get_handle(handle, "_EJ0", &tmp); | 417 | if (acpi_has_method(handle, "_EJ0")) |
420 | if (ACPI_SUCCESS(status)) | ||
421 | return 1; | 418 | return 1; |
422 | status = acpi_evaluate_integer(handle, "_RMV", NULL, &removable); | 419 | status = acpi_evaluate_integer(handle, "_RMV", NULL, &removable); |
423 | if (ACPI_SUCCESS(status) && removable) | 420 | if (ACPI_SUCCESS(status) && removable) |
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index 5246ba297470..e98018b43e2a 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c | |||
@@ -990,14 +990,16 @@ void acpiphp_enumerate_slots(struct pci_bus *bus) | |||
990 | 990 | ||
991 | /* | 991 | /* |
992 | * This bridge should have been registered as a hotplug function | 992 | * This bridge should have been registered as a hotplug function |
993 | * under its parent, so the context has to be there. If not, we | 993 | * under its parent, so the context should be there, unless the |
994 | * are in deep goo. | 994 | * parent is going to be handled by pciehp, in which case this |
995 | * bridge is not interesting to us either. | ||
995 | */ | 996 | */ |
996 | mutex_lock(&acpiphp_context_lock); | 997 | mutex_lock(&acpiphp_context_lock); |
997 | context = acpiphp_get_context(handle); | 998 | context = acpiphp_get_context(handle); |
998 | if (WARN_ON(!context)) { | 999 | if (!context) { |
999 | mutex_unlock(&acpiphp_context_lock); | 1000 | mutex_unlock(&acpiphp_context_lock); |
1000 | put_device(&bus->dev); | 1001 | put_device(&bus->dev); |
1002 | pci_dev_put(bridge->pci_dev); | ||
1001 | kfree(bridge); | 1003 | kfree(bridge); |
1002 | return; | 1004 | return; |
1003 | } | 1005 | } |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index b0299e6d9a3f..dfd1f59de729 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -181,7 +181,6 @@ static bool acpi_pci_power_manageable(struct pci_dev *dev) | |||
181 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | 181 | static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) |
182 | { | 182 | { |
183 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); | 183 | acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev); |
184 | acpi_handle tmp; | ||
185 | static const u8 state_conv[] = { | 184 | static const u8 state_conv[] = { |
186 | [PCI_D0] = ACPI_STATE_D0, | 185 | [PCI_D0] = ACPI_STATE_D0, |
187 | [PCI_D1] = ACPI_STATE_D1, | 186 | [PCI_D1] = ACPI_STATE_D1, |
@@ -192,7 +191,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
192 | int error = -EINVAL; | 191 | int error = -EINVAL; |
193 | 192 | ||
194 | /* If the ACPI device has _EJ0, ignore the device */ | 193 | /* If the ACPI device has _EJ0, ignore the device */ |
195 | if (!handle || ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp))) | 194 | if (!handle || acpi_has_method(handle, "_EJ0")) |
196 | return -ENODEV; | 195 | return -ENODEV; |
197 | 196 | ||
198 | switch (state) { | 197 | switch (state) { |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e8ccf6c0f08a..bdd64b1b4817 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1155,8 +1155,14 @@ static void pci_enable_bridge(struct pci_dev *dev) | |||
1155 | 1155 | ||
1156 | pci_enable_bridge(dev->bus->self); | 1156 | pci_enable_bridge(dev->bus->self); |
1157 | 1157 | ||
1158 | if (pci_is_enabled(dev)) | 1158 | if (pci_is_enabled(dev)) { |
1159 | if (!dev->is_busmaster) { | ||
1160 | dev_warn(&dev->dev, "driver skip pci_set_master, fix it!\n"); | ||
1161 | pci_set_master(dev); | ||
1162 | } | ||
1159 | return; | 1163 | return; |
1164 | } | ||
1165 | |||
1160 | retval = pci_enable_device(dev); | 1166 | retval = pci_enable_device(dev); |
1161 | if (retval) | 1167 | if (retval) |
1162 | dev_err(&dev->dev, "Error enabling bridge (%d), continuing\n", | 1168 | dev_err(&dev->dev, "Error enabling bridge (%d), continuing\n", |