Skip to content

Commit a60a708

Browse files
floatiouskwilczynski
authored andcommitted
PCI: dwc: ep: Remove superfluous function dw_pcie_ep_find_ext_capability()
Remove the superfluous function dw_pcie_ep_find_ext_capability(), as it is virtually identical to dw_pcie_find_ext_capability(). Signed-off-by: Niklas Cassel <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 934e9d1 commit a60a708

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,24 +102,6 @@ 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-
123105
static int dw_pcie_ep_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
124106
struct pci_epf_header *hdr)
125107
{
@@ -230,7 +212,7 @@ static unsigned int dw_pcie_ep_get_rebar_offset(struct dw_pcie *pci,
230212
unsigned int offset, nbars;
231213
int i;
232214

233-
offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
215+
offset = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
234216
if (!offset)
235217
return offset;
236218

@@ -846,7 +828,7 @@ static void dw_pcie_ep_init_non_sticky_registers(struct dw_pcie *pci)
846828
enum pci_barno bar;
847829
u32 reg, i, val;
848830

849-
offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
831+
offset = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR);
850832

851833
dw_pcie_dbi_ro_wr_en(pci);
852834

@@ -969,7 +951,7 @@ int dw_pcie_ep_init_registers(struct dw_pcie_ep *ep)
969951
if (ep->ops->init)
970952
ep->ops->init(ep);
971953

972-
ptm_cap_base = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_PTM);
954+
ptm_cap_base = dw_pcie_find_ext_capability(pci, PCI_EXT_CAP_ID_PTM);
973955

974956
/*
975957
* PTM responder capability can be disabled only after disabling

0 commit comments

Comments
 (0)