aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
diff options
context:
space:
mode:
authorAlexey Skidanov <Alexey.Skidanov@amd.com>2014-11-18 14:00:04 +0200
committerOded Gabbay <oded.gabbay@amd.com>2015-01-09 22:25:58 +0200
commit093c7d8cfd2a26ff05e3bdff63d371147df1951c (patch)
treea308fb36ec1d2d18480c5b0547d87160d52c1441 /drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
parentdrm/amdkfd: Add number of watch points to topology (diff)
downloadlinux-dev-093c7d8cfd2a26ff05e3bdff63d371147df1951c.tar.xz
linux-dev-093c7d8cfd2a26ff05e3bdff63d371147df1951c.zip
drm/amdkfd: Process-device data creation and lookup split
This patch splits the current kfd_get_process_device_data() to two functions, one that specifically creates a pdd and another one which just do lookup. This is done to enhance the readability and maintainability of the code. Signed-off-by: Alexey Skidanov <Alexey.Skidanov@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
index e64aa99e5e41..35b987574633 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c
@@ -303,10 +303,11 @@ int kfd_init_apertures(struct kfd_process *process)
while ((dev = kfd_topology_enum_kfd_devices(id)) != NULL &&
id < NUM_OF_SUPPORTED_GPUS) {
- pdd = kfd_get_process_device_data(dev, process, 1);
- if (!pdd)
+ pdd = kfd_create_process_device_data(dev, process);
+ if (pdd == NULL) {
+ pr_err("Failed to create process device data\n");
return -1;
-
+ }
/*
* For 64 bit process aperture will be statically reserved in
* the x86_64 non canonical process address space