Skip to content

Commit 30a172d

Browse files
floatiouskwilczynski
authored andcommitted
PCI: dwc: ep: Move dw_pcie_ep_find_ext_capability()
Move dw_pcie_ep_find_ext_capability() so that it is located next to dw_pcie_ep_find_capability(). Additionally, a follow-up commit requires this to be defined earlier in order to avoid a forward declaration. Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Niklas Cassel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 4eb2084 commit 30a172d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

drivers/pci/controller/dwc/pcie-designware-ep.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ static u8 dw_pcie_ep_find_capability(struct dw_pcie_ep *ep, u8 func_no, u8 cap)
102102
return __dw_pcie_ep_find_next_cap(ep, func_no, next_cap_ptr, cap);
103103
}
104104

105+
static unsigned int dw_pcie_ep_find_ext_capability(struct dw_pcie *pci, int cap)
106+
{
107+
u32 header;
108+
int pos = PCI_CFG_SPACE_SIZE;
109+
110+
while (pos) {
111+
header = dw_pcie_readl_dbi(pci, pos);
112+
if (PCI_EXT_CAP_ID(header) == cap)
113+
return pos;
114+
115+
pos = PCI_EXT_CAP_NEXT(header);
116+
if (!pos)
117+
break;
118+
}
119+
120+
return 0;
121+
}
122+
105123
static int dw_pcie_ep_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
106124
struct pci_epf_header *hdr)
107125
{
@@ -690,24 +708,6 @@ void dw_pcie_ep_deinit(struct dw_pcie_ep *ep)
690708
}
691709
EXPORT_SYMBOL_GPL(dw_pcie_ep_deinit);
692710

693-
static unsigned int dw_pcie_ep_find_ext_capability(struct dw_pcie *pci, int cap)
694-
{
695-
u32 header;
696-
int pos = PCI_CFG_SPACE_SIZE;
697-
698-
while (pos) {
699-
header = dw_pcie_readl_dbi(pci, pos);
700-
if (PCI_EXT_CAP_ID(header) == cap)
701-
return pos;
702-
703-
pos = PCI_EXT_CAP_NEXT(header);
704-
if (!pos)
705-
break;
706-
}
707-
708-
return 0;
709-
}
710-
711711
static void dw_pcie_ep_init_non_sticky_registers(struct dw_pcie *pci)
712712
{
713713
unsigned int offset;

0 commit comments

Comments
 (0)