Commit cbfba01d authored by Huang Rui's avatar Huang Rui Committed by Alex Deucher

drm/amd/powerplay: use the table size member in the structure instead of getting directly

This patch uses the table size member in the structure instead of getting
directly, because the table is different in each asic.
Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 33bd73ae
......@@ -675,11 +675,12 @@ static int smu_v11_0_parse_pptable(struct smu_context *smu)
int ret;
struct smu_table_context *table_context = &smu->smu_table;
struct smu_table *table = &table_context->tables[SMU_TABLE_PPTABLE];
if (table_context->driver_pptable)
return -EINVAL;
table_context->driver_pptable = kzalloc(sizeof(PPTable_t), GFP_KERNEL);
table_context->driver_pptable = kzalloc(table->size, GFP_KERNEL);
if (!table_context->driver_pptable)
return -ENOMEM;
......@@ -1649,6 +1650,7 @@ static int smu_v11_0_set_od8_default_settings(struct smu_context *smu,
bool initialize)
{
struct smu_table_context *table_context = &smu->smu_table;
struct smu_table *table = &table_context->tables[SMU_TABLE_OVERDRIVE];
int ret;
/**
......@@ -1662,7 +1664,7 @@ static int smu_v11_0_set_od8_default_settings(struct smu_context *smu,
if (table_context->overdrive_table)
return -EINVAL;
table_context->overdrive_table = kzalloc(sizeof(OverDriveTable_t), GFP_KERNEL);
table_context->overdrive_table = kzalloc(table->size, GFP_KERNEL);
if (!table_context->overdrive_table)
return -ENOMEM;
......
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