Commit d8d090b7 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: allocate ip_block_enabled memory in common code

Remove duplication across asic families and make it symmetric
with the freeing of the code in amdgpu_device.c
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a08c1d51
...@@ -1191,7 +1191,9 @@ static int amdgpu_early_init(struct amdgpu_device *adev) ...@@ -1191,7 +1191,9 @@ static int amdgpu_early_init(struct amdgpu_device *adev)
return -EINVAL; return -EINVAL;
} }
adev->ip_block_enabled = kcalloc(adev->num_ip_blocks, sizeof(bool), GFP_KERNEL);
if (adev->ip_block_enabled == NULL)
return -ENOMEM;
if (adev->ip_blocks == NULL) { if (adev->ip_blocks == NULL) {
DRM_ERROR("No IP blocks found!\n"); DRM_ERROR("No IP blocks found!\n");
......
...@@ -2256,10 +2256,6 @@ int cik_set_ip_blocks(struct amdgpu_device *adev) ...@@ -2256,10 +2256,6 @@ int cik_set_ip_blocks(struct amdgpu_device *adev)
return -EINVAL; return -EINVAL;
} }
adev->ip_block_enabled = kcalloc(adev->num_ip_blocks, sizeof(bool), GFP_KERNEL);
if (adev->ip_block_enabled == NULL)
return -ENOMEM;
return 0; return 0;
} }
......
...@@ -1189,10 +1189,6 @@ int vi_set_ip_blocks(struct amdgpu_device *adev) ...@@ -1189,10 +1189,6 @@ int vi_set_ip_blocks(struct amdgpu_device *adev)
return -EINVAL; return -EINVAL;
} }
adev->ip_block_enabled = kcalloc(adev->num_ip_blocks, sizeof(bool), GFP_KERNEL);
if (adev->ip_block_enabled == NULL)
return -ENOMEM;
return 0; return 0;
} }
......
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