mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
PCI: Move pci_resource_alignment() to setup-res.c file
pci_resource_alignment() is a bit on the complex side to have in a header so put it into setup-res.c. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20260429122617.7324-10-ilpo.jarvinen@linux.intel.com
This commit is contained in:
parent
1845201aa5
commit
e9310aa3d2
|
|
@ -1044,17 +1044,8 @@ static inline void pci_suspend_ptm(struct pci_dev *dev) { }
|
|||
static inline void pci_resume_ptm(struct pci_dev *dev) { }
|
||||
#endif
|
||||
|
||||
static inline resource_size_t pci_resource_alignment(const struct pci_dev *dev,
|
||||
const struct resource *res)
|
||||
{
|
||||
int resno = pci_resource_num(dev, res);
|
||||
|
||||
if (pci_resource_is_iov(resno))
|
||||
return pci_sriov_resource_alignment(dev, resno);
|
||||
if (dev->class >> 8 == PCI_CLASS_BRIDGE_CARDBUS)
|
||||
return pci_cardbus_resource_alignment(res);
|
||||
return resource_alignment(res);
|
||||
}
|
||||
resource_size_t pci_resource_alignment(const struct pci_dev *dev,
|
||||
const struct resource *res);
|
||||
|
||||
resource_size_t pci_min_window_alignment(struct pci_bus *bus,
|
||||
unsigned long type);
|
||||
|
|
|
|||
|
|
@ -246,6 +246,18 @@ static int pci_revert_fw_address(struct resource *res, struct pci_dev *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
resource_size_t pci_resource_alignment(const struct pci_dev *dev,
|
||||
const struct resource *res)
|
||||
{
|
||||
int resno = pci_resource_num(dev, res);
|
||||
|
||||
if (pci_resource_is_iov(resno))
|
||||
return pci_sriov_resource_alignment(dev, resno);
|
||||
if (dev->class >> 8 == PCI_CLASS_BRIDGE_CARDBUS)
|
||||
return pci_cardbus_resource_alignment(res);
|
||||
return resource_alignment(res);
|
||||
}
|
||||
|
||||
/*
|
||||
* For mem bridge windows, try to relocate tail remainder space to space
|
||||
* before res->start if there's enough free space there. This enables
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user