Refactor pciTagConvertRange2Host and pciConvertRange2Host.
This commit is contained in:
parent
1a493509e3
commit
3936caa005
|
@ -1025,9 +1025,17 @@ xf86CheckPciSlot(const struct pci_device *d)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
pciTagConvertRange2Host(PCITAG tag, resRange *pRange)
|
||||
void
|
||||
pciConvertRange2Host(int entityIndex, resRange *pRange)
|
||||
{
|
||||
struct pci_device *const pvp = xf86GetPciInfoForEntity(entityIndex);
|
||||
const PCITAG tag = PCI_MAKE_TAG(PCI_MAKE_BUS(pvp->domain, pvp->bus),
|
||||
pvp->dev, pvp->func);
|
||||
|
||||
if (pvp == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(pRange->type & ResBus))
|
||||
return;
|
||||
|
||||
|
@ -1066,15 +1074,3 @@ pciTagConvertRange2Host(PCITAG tag, resRange *pRange)
|
|||
pRange->type &= ~(ResDomain | ResBus);
|
||||
pRange->type |= xf86GetPciDomain(tag) << 24;
|
||||
}
|
||||
|
||||
void
|
||||
pciConvertRange2Host(int entityIndex, resRange *pRange)
|
||||
{
|
||||
const struct pci_device * const pvp = xf86GetPciInfoForEntity(entityIndex);
|
||||
|
||||
if ( pvp != NULL ) {
|
||||
const PCITAG tag = PCI_MAKE_TAG( PCI_MAKE_BUS( pvp->domain, pvp->bus ),
|
||||
pvp->dev, pvp->func );
|
||||
pciTagConvertRange2Host(tag, pRange);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user