[Nouveau] [PATCH 1/4] nouveau: Remove unneeded xf86GetEntityInfo()

Emil Velikov emil.l.velikov at gmail.com
Thu Nov 1 20:57:39 PDT 2012


Retrieving the whole entity information is not needed as we only
use the index - stored already in entity_num

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/nv_driver.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/nv_driver.c b/src/nv_driver.c
index 9b5b9d6..c885e73 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -261,7 +261,6 @@ NVPciProbe(DriverPtr drv, int entity_num, struct pci_device *pci_dev,
 		{ -1, -1, NULL }
 	};
 	struct nouveau_device *dev = NULL;
-	EntityInfoPtr pEnt = NULL;
 	ScrnInfoPtr pScrn = NULL;
 	drmVersion *version;
 	int chipset, ret;
@@ -340,10 +339,8 @@ NVPciProbe(DriverPtr drv, int entity_num, struct pci_device *pci_dev,
 	pScrn->FreeScreen       = NVFreeScreen;
 
 	xf86SetEntitySharable(entity_num);
-
-	pEnt = xf86GetEntityInfo(entity_num);
-	xf86SetEntityInstanceForScreen(pScrn, pEnt->index, xf86GetNumEntityInstances(pEnt->index) - 1);
-	free(pEnt);
+	xf86SetEntityInstanceForScreen(pScrn, entity_num,
+					xf86GetNumEntityInstances(entity_num) - 1);
 
 	return TRUE;
 }
-- 
1.8.0



More information about the Nouveau mailing list