Skip to content

Commit a2492ff

Browse files
Thippeswamy Havaligekwilczynski
authored andcommitted
PCI: xilinx-nwl: Remove redundant code that sets Type 1 header fields
The PCI core already updates the primary, secondary and subordinate bus number registers fields of the Type 1 header. Thus, remove the redundant code from the nwl_pcie_bridge_init(). [kwilczynski: commit log] Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Thippeswamy Havalige <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 0bb80ec commit a2492ff

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

drivers/pci/controller/pcie-xilinx-nwl.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ struct nwl_pcie {
166166
int irq_intx;
167167
int irq_misc;
168168
u32 ecam_value;
169-
u8 last_busno;
170169
struct nwl_msi msi;
171170
struct irq_domain *legacy_irq_domain;
172171
struct clk *clk;
@@ -625,7 +624,7 @@ static int nwl_pcie_bridge_init(struct nwl_pcie *pcie)
625624
{
626625
struct device *dev = pcie->dev;
627626
struct platform_device *pdev = to_platform_device(dev);
628-
u32 breg_val, ecam_val, first_busno = 0;
627+
u32 breg_val, ecam_val;
629628
int err;
630629

631630
breg_val = nwl_bridge_readl(pcie, E_BREG_CAPABILITIES) & BREG_PRESENT;
@@ -683,15 +682,6 @@ static int nwl_pcie_bridge_init(struct nwl_pcie *pcie)
683682
nwl_bridge_writel(pcie, upper_32_bits(pcie->phys_ecam_base),
684683
E_ECAM_BASE_HI);
685684

686-
/* Get bus range */
687-
ecam_val = nwl_bridge_readl(pcie, E_ECAM_CONTROL);
688-
pcie->last_busno = (ecam_val & E_ECAM_SIZE_LOC) >> E_ECAM_SIZE_SHIFT;
689-
/* Write primary, secondary and subordinate bus numbers */
690-
ecam_val = first_busno;
691-
ecam_val |= (first_busno + 1) << 8;
692-
ecam_val |= (pcie->last_busno << E_ECAM_SIZE_SHIFT);
693-
writel(ecam_val, (pcie->ecam_base + PCI_PRIMARY_BUS));
694-
695685
if (nwl_pcie_link_up(pcie))
696686
dev_info(dev, "Link is UP\n");
697687
else

0 commit comments

Comments
 (0)