From dd12a94885bad9c9d064dcf7e0d9a7a7114ae3e6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 12 Jan 2007 10:21:25 -0800 Subject: [PATCH] Eliminate xf86GetPciEntity from public interface. xf86GetPciEntity was folded into the only place (xf86CheckPciSlot) in the tree that still called it. --- hw/xfree86/common/xf86.h | 1 - hw/xfree86/common/xf86pciBus.c | 35 ++++++++++++++-------------------- hw/xfree86/loader/xf86sym.c | 1 - 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index e96157e18..d7fd04540 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -134,7 +134,6 @@ GDevPtr xf86GetDevFromEntity(int entityIndex, int instance); void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex); EntityInfoPtr xf86GetEntityInfo(int entityIndex); struct pci_device * xf86GetPciInfoForEntity(int entityIndex); -int xf86GetPciEntity(int bus, int dev, int func); Bool xf86SetEntityFuncs(int entityIndex, EntityProc init, EntityProc enter, EntityProc leave, pointer); void xf86DeallocateResourcesForEntity(int entityIndex, unsigned long type); diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 5f09fabed..e54de142a 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1002,24 +1002,6 @@ xf86GetPciInfoForEntity(int entityIndex) : NULL; } -_X_EXPORT int -xf86GetPciEntity(int bus, int dev, int func) -{ - int i; - - for (i = 0; i < xf86NumEntities; i++) { - const EntityPtr p = xf86Entities[i]; - - if ((p->busType == BUS_PCI) && - (p->pciBusId.bus == bus) && - (p->pciBusId.device == dev) && - (p->pciBusId.func == func)) { - return i; - } - } - return -1; -} - /* * xf86CheckPciMemBase() checks that the memory base value matches one of the * PCI base address register values for the given PCI device. @@ -1040,10 +1022,21 @@ xf86CheckPciMemBase( struct pci_device * pPci, memType base ) */ _X_EXPORT Bool -xf86CheckPciSlot( const struct pci_device * d ) +xf86CheckPciSlot(const struct pci_device *d) { - return (xf86GetPciEntity(PCI_MAKE_BUS(d->domain, d->bus), - d->dev, d->func) == -1); + int i; + + for (i = 0; i < xf86NumEntities; i++) { + const EntityPtr p = xf86Entities[i]; + + if ((p->busType == BUS_PCI) && + (p->pciBusId.bus == PCI_MAKE_BUS(d->domain, d->bus)) && + (p->pciBusId.device == d->dev) && + (p->pciBusId.func == d->func)) { + return FALSE; + } + } + return TRUE; } diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 5e7a288b6..744064a39 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -298,7 +298,6 @@ _X_HIDDEN void *xfree86LookupTab[] = { /* xf86Bus.c */ SYMFUNC(xf86CheckPciSlot) SYMFUNC(xf86ClaimPciSlot) - SYMFUNC(xf86GetPciEntity) SYMFUNC(xf86ClaimIsaSlot) SYMFUNC(xf86ClaimFbSlot) SYMFUNC(xf86ClaimNoSlot)