diff options
author | Jiri Kosina <jkosina@suse.cz> | 2018-10-23 13:19:54 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-10-23 13:19:54 +0200 |
commit | a600ffe6ec609b0600ec590236f97f8d430e0984 (patch) | |
tree | 57432877c74c80ab470d7b655a2e18a6b5168ee5 /drivers/gpu/drm/amd/amdkfd/kfd_topology.c | |
parent | d19031d32cd77b2878a006040e0f8e4183ca59ef (diff) | |
parent | 23e542e5ba5e4298a1475f94750317ec1662ba21 (diff) | |
download | talos-obmc-linux-a600ffe6ec609b0600ec590236f97f8d430e0984.tar.gz talos-obmc-linux-a600ffe6ec609b0600ec590236f97f8d430e0984.zip |
Merge branch 'for-4.20/google' into for-linus
Whisker device specific fixes to hid-google driver
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_topology.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index bc95d4dfee2e..80f5db4ef75f 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -63,22 +63,33 @@ struct kfd_topology_device *kfd_topology_device_by_proximity_domain( return device; } -struct kfd_dev *kfd_device_by_id(uint32_t gpu_id) +struct kfd_topology_device *kfd_topology_device_by_id(uint32_t gpu_id) { - struct kfd_topology_device *top_dev; - struct kfd_dev *device = NULL; + struct kfd_topology_device *top_dev = NULL; + struct kfd_topology_device *ret = NULL; down_read(&topology_lock); list_for_each_entry(top_dev, &topology_device_list, list) if (top_dev->gpu_id == gpu_id) { - device = top_dev->gpu; + ret = top_dev; break; } up_read(&topology_lock); - return device; + return ret; +} + +struct kfd_dev *kfd_device_by_id(uint32_t gpu_id) +{ + struct kfd_topology_device *top_dev; + + top_dev = kfd_topology_device_by_id(gpu_id); + if (!top_dev) + return NULL; + + return top_dev->gpu; } struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev) |