Commit 681f7d9d authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Jesse Barnes

pci-acpi: add flag to indicate query had been done

Current pci-acpi implementation checks osc_data->support_stat to see
if control bits had been already queried. It is not good from the
viewpoint of easy understanding. So this patch adds new 'is_queried'
flag to indicate query had been done.
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: default avatarShaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 5e0b9947
...@@ -23,6 +23,7 @@ struct acpi_osc_data { ...@@ -23,6 +23,7 @@ struct acpi_osc_data {
acpi_handle handle; acpi_handle handle;
u32 support_set; u32 support_set;
u32 control_set; u32 control_set;
int is_queried;
u32 query_result; u32 query_result;
struct list_head sibiling; struct list_head sibiling;
}; };
...@@ -147,6 +148,7 @@ static acpi_status acpi_query_osc(acpi_handle handle, ...@@ -147,6 +148,7 @@ static acpi_status acpi_query_osc(acpi_handle handle,
if (ACPI_SUCCESS(status)) { if (ACPI_SUCCESS(status)) {
osc_data->support_set = support_set; osc_data->support_set = support_set;
osc_data->query_result = osc_args.query_result; osc_data->query_result = osc_args.query_result;
osc_data->is_queried = 1;
} }
return status; return status;
...@@ -203,7 +205,7 @@ acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) ...@@ -203,7 +205,7 @@ acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
if (!ctrlset) if (!ctrlset)
return AE_TYPE; return AE_TYPE;
if (osc_data->support_set && if (osc_data->is_queried &&
((osc_data->query_result & ctrlset) != ctrlset)) ((osc_data->query_result & ctrlset) != ctrlset))
return AE_SUPPORT; return AE_SUPPORT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment