diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-08-20 19:52:37 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-08-24 16:43:20 -0400 |
commit | b879dc4b3e81069e3f715b7569bb0f43eed76c76 (patch) | |
tree | b60fadcfd78c7b4fa086f381333786dc42671cab /drivers/acpi | |
parent | 79dd9182db2072d63ccf160bb9a3463b1c952723 (diff) |
ACPI/PCI: Reorder checks in acpi_pci_osc_control_set()
Make acpi_pci_osc_control_set() attempt to find the handle of the
_OSC object under the given PCI root bridge object after verifying
that its second argument is correct and that there is a struct
acpi_pci_root object for the given root bridge handle, which is
more logical than the old code.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/pci_root.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 1f67057af2a5..e10dbafa0569 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -378,10 +378,6 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags) | |||
378 | acpi_handle tmp; | 378 | acpi_handle tmp; |
379 | struct acpi_pci_root *root; | 379 | struct acpi_pci_root *root; |
380 | 380 | ||
381 | status = acpi_get_handle(handle, "_OSC", &tmp); | ||
382 | if (ACPI_FAILURE(status)) | ||
383 | return status; | ||
384 | |||
385 | control_req = (flags & OSC_PCI_CONTROL_MASKS); | 381 | control_req = (flags & OSC_PCI_CONTROL_MASKS); |
386 | if (!control_req) | 382 | if (!control_req) |
387 | return AE_TYPE; | 383 | return AE_TYPE; |
@@ -390,6 +386,10 @@ acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags) | |||
390 | if (!root) | 386 | if (!root) |
391 | return AE_NOT_EXIST; | 387 | return AE_NOT_EXIST; |
392 | 388 | ||
389 | status = acpi_get_handle(handle, "_OSC", &tmp); | ||
390 | if (ACPI_FAILURE(status)) | ||
391 | return status; | ||
392 | |||
393 | mutex_lock(&osc_lock); | 393 | mutex_lock(&osc_lock); |
394 | /* No need to evaluate _OSC if the control was already granted. */ | 394 | /* No need to evaluate _OSC if the control was already granted. */ |
395 | if ((root->osc_control_set & control_req) == control_req) | 395 | if ((root->osc_control_set & control_req) == control_req) |