drm/amd/pm: Skip power state allocation
authorLijo Lazar <lijo.lazar@amd.com>
Tue, 14 Dec 2021 07:04:47 +0000 (15:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 14 Dec 2021 21:09:42 +0000 (16:09 -0500)
Power states are not valid for arcturus and aldebaran, no need to
allocate memory.

Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c

index 05defee..58bc387 100644 (file)
@@ -295,16 +295,6 @@ static int arcturus_allocate_dpm_context(struct smu_context *smu)
                return -ENOMEM;
        smu_dpm->dpm_context_size = sizeof(struct smu_11_0_dpm_context);
 
-       smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct smu_power_state),
-                                      GFP_KERNEL);
-       if (!smu_dpm->dpm_current_power_state)
-               return -ENOMEM;
-
-       smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct smu_power_state),
-                                      GFP_KERNEL);
-       if (!smu_dpm->dpm_request_power_state)
-               return -ENOMEM;
-
        return 0;
 }
 
index 6e781ce..0907da0 100644 (file)
@@ -262,16 +262,6 @@ static int aldebaran_allocate_dpm_context(struct smu_context *smu)
                return -ENOMEM;
        smu_dpm->dpm_context_size = sizeof(struct smu_13_0_dpm_context);
 
-       smu_dpm->dpm_current_power_state = kzalloc(sizeof(struct smu_power_state),
-                                                  GFP_KERNEL);
-       if (!smu_dpm->dpm_current_power_state)
-               return -ENOMEM;
-
-       smu_dpm->dpm_request_power_state = kzalloc(sizeof(struct smu_power_state),
-                                                  GFP_KERNEL);
-       if (!smu_dpm->dpm_request_power_state)
-               return -ENOMEM;
-
        return 0;
 }