aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-06-26 13:02:57 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-06-29 11:21:52 -0400
commitd8d090b711bc56e095e59f9b536ed3c73c47b36d (patch)
tree9b236de7f5be2d862c8fcc660dbb15c36c6646e8
parenta08c1d516fb3eb302ff14a10eedda844e75c625f (diff)
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: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/cik.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vi.c4
3 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index a85cd08901a7..e19097554093 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1191,7 +1191,9 @@ static int amdgpu_early_init(struct amdgpu_device *adev)
1191 return -EINVAL; 1191 return -EINVAL;
1192 } 1192 }
1193 1193
1194 1194 adev->ip_block_enabled = kcalloc(adev->num_ip_blocks, sizeof(bool), GFP_KERNEL);
1195 if (adev->ip_block_enabled == NULL)
1196 return -ENOMEM;
1195 1197
1196 if (adev->ip_blocks == NULL) { 1198 if (adev->ip_blocks == NULL) {
1197 DRM_ERROR("No IP blocks found!\n"); 1199 DRM_ERROR("No IP blocks found!\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 5dab578d6462..341c56681841 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2256,10 +2256,6 @@ int cik_set_ip_blocks(struct amdgpu_device *adev)
2256 return -EINVAL; 2256 return -EINVAL;
2257 } 2257 }
2258 2258
2259 adev->ip_block_enabled = kcalloc(adev->num_ip_blocks, sizeof(bool), GFP_KERNEL);
2260 if (adev->ip_block_enabled == NULL)
2261 return -ENOMEM;
2262
2263 return 0; 2259 return 0;
2264} 2260}
2265 2261
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 90fc93c2c1d0..fa5a4448531d 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1189,10 +1189,6 @@ int vi_set_ip_blocks(struct amdgpu_device *adev)
1189 return -EINVAL; 1189 return -EINVAL;
1190 } 1190 }
1191 1191
1192 adev->ip_block_enabled = kcalloc(adev->num_ip_blocks, sizeof(bool), GFP_KERNEL);
1193 if (adev->ip_block_enabled == NULL)
1194 return -ENOMEM;
1195
1196 return 0; 1192 return 0;
1197} 1193}
1198 1194