summaryrefslogtreecommitdiff
path: root/src/amdgpu_probe.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-10-28 17:56:13 +0900
committerMichel Dänzer <michel@daenzer.net>2015-10-28 17:56:13 +0900
commitcef725121eb0e56aa54d9c4665e36047373f4db7 (patch)
tree72c1874adf3139499ba1c0664f7f6d15bcb1cd40 /src/amdgpu_probe.c
parent3b0a3c89b53b3ebe21a9d703a4dbff6e57c65a57 (diff)
Remove dead code from probe paths
amdgpu_get_scrninfo allocates the memory pointed to by pAMDGPUEnt just before it calls amdgpu_open_drm_master, so pAMDGPUEnt->fd is always 0 in the latter. Also, no need to clear pAMDGPUEnt->fd just before freeing the memory it's stored in. Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'src/amdgpu_probe.c')
-rw-r--r--src/amdgpu_probe.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/amdgpu_probe.c b/src/amdgpu_probe.c
index 481271b..28430b2 100644
--- a/src/amdgpu_probe.c
+++ b/src/amdgpu_probe.c
@@ -150,19 +150,9 @@ static int amdgpu_kernel_open_fd(ScrnInfoPtr pScrn, struct pci_device *dev,
static Bool amdgpu_open_drm_master(ScrnInfoPtr pScrn)
{
AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
- AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
drmSetVersion sv;
int err;
- if (pAMDGPUEnt->fd) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- " reusing fd for second head\n");
-
- info->drmmode.fd = info->dri2.drm_fd = pAMDGPUEnt->fd;
- pAMDGPUEnt->fd_ref++;
- return TRUE;
- }
-
info->dri2.drm_fd = amdgpu_kernel_open_fd(pScrn, info->PciInfo, NULL);
if (info->dri2.drm_fd == -1)
return FALSE;
@@ -266,7 +256,6 @@ static Bool amdgpu_get_scrninfo(int entity_num, void *pci_dev)
error_amdgpu:
drmClose(pAMDGPUEnt->fd);
- pAMDGPUEnt->fd = 0;
error_fd:
free(pPriv->ptr);
return FALSE;
@@ -383,7 +372,6 @@ amdgpu_platform_probe(DriverPtr pDriver,
error_amdgpu:
drmClose(pAMDGPUEnt->fd);
- pAMDGPUEnt->fd = 0;
error_fd:
free(pPriv->ptr);
return FALSE;