Skip to content

Commit 5e93232

Browse files
toshikanirafaeljw
authored andcommitted
intel_pstate: convert to use acpi_match_platform_list()
Convert to use acpi_match_platform_list() for the platform check. There is no change in functionality. Signed-off-by: Toshi Kani <[email protected]> Acked-by: Srinivas Pandruvada <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5aa5911 commit 5e93232

File tree

1 file changed

+25
-39
lines changed

1 file changed

+25
-39
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,39 +2466,31 @@ enum {
24662466
PPC,
24672467
};
24682468

2469-
struct hw_vendor_info {
2470-
u16 valid;
2471-
char oem_id[ACPI_OEM_ID_SIZE];
2472-
char oem_table_id[ACPI_OEM_TABLE_ID_SIZE];
2473-
int oem_pwr_table;
2474-
};
2475-
24762469
/* Hardware vendor-specific info that has its own power management modes */
2477-
static struct hw_vendor_info vendor_info[] __initdata = {
2478-
{1, "HP ", "ProLiant", PSS},
2479-
{1, "ORACLE", "X4-2 ", PPC},
2480-
{1, "ORACLE", "X4-2L ", PPC},
2481-
{1, "ORACLE", "X4-2B ", PPC},
2482-
{1, "ORACLE", "X3-2 ", PPC},
2483-
{1, "ORACLE", "X3-2L ", PPC},
2484-
{1, "ORACLE", "X3-2B ", PPC},
2485-
{1, "ORACLE", "X4470M2 ", PPC},
2486-
{1, "ORACLE", "X4270M3 ", PPC},
2487-
{1, "ORACLE", "X4270M2 ", PPC},
2488-
{1, "ORACLE", "X4170M2 ", PPC},
2489-
{1, "ORACLE", "X4170 M3", PPC},
2490-
{1, "ORACLE", "X4275 M3", PPC},
2491-
{1, "ORACLE", "X6-2 ", PPC},
2492-
{1, "ORACLE", "Sudbury ", PPC},
2493-
{0, "", ""},
2470+
static struct acpi_platform_list plat_info[] __initdata = {
2471+
{"HP ", "ProLiant", 0, ACPI_SIG_FADT, all_versions, 0, PSS},
2472+
{"ORACLE", "X4-2 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2473+
{"ORACLE", "X4-2L ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2474+
{"ORACLE", "X4-2B ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2475+
{"ORACLE", "X3-2 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2476+
{"ORACLE", "X3-2L ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2477+
{"ORACLE", "X3-2B ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2478+
{"ORACLE", "X4470M2 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2479+
{"ORACLE", "X4270M3 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2480+
{"ORACLE", "X4270M2 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2481+
{"ORACLE", "X4170M2 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2482+
{"ORACLE", "X4170 M3", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2483+
{"ORACLE", "X4275 M3", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2484+
{"ORACLE", "X6-2 ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2485+
{"ORACLE", "Sudbury ", 0, ACPI_SIG_FADT, all_versions, 0, PPC},
2486+
{ } /* End */
24942487
};
24952488

24962489
static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
24972490
{
2498-
struct acpi_table_header hdr;
2499-
struct hw_vendor_info *v_info;
25002491
const struct x86_cpu_id *id;
25012492
u64 misc_pwr;
2493+
int idx;
25022494

25032495
id = x86_match_cpu(intel_pstate_cpu_oob_ids);
25042496
if (id) {
@@ -2507,21 +2499,15 @@ static bool __init intel_pstate_platform_pwr_mgmt_exists(void)
25072499
return true;
25082500
}
25092501

2510-
if (acpi_disabled ||
2511-
ACPI_FAILURE(acpi_get_table_header(ACPI_SIG_FADT, 0, &hdr)))
2502+
idx = acpi_match_platform_list(plat_info);
2503+
if (idx < 0)
25122504
return false;
25132505

2514-
for (v_info = vendor_info; v_info->valid; v_info++) {
2515-
if (!strncmp(hdr.oem_id, v_info->oem_id, ACPI_OEM_ID_SIZE) &&
2516-
!strncmp(hdr.oem_table_id, v_info->oem_table_id,
2517-
ACPI_OEM_TABLE_ID_SIZE))
2518-
switch (v_info->oem_pwr_table) {
2519-
case PSS:
2520-
return intel_pstate_no_acpi_pss();
2521-
case PPC:
2522-
return intel_pstate_has_acpi_ppc() &&
2523-
(!force_load);
2524-
}
2506+
switch (plat_info[idx].data) {
2507+
case PSS:
2508+
return intel_pstate_no_acpi_pss();
2509+
case PPC:
2510+
return intel_pstate_has_acpi_ppc() && !force_load;
25252511
}
25262512

25272513
return false;

0 commit comments

Comments
 (0)