]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: artpec6: Use common mode field in struct dw_pcie
authorHans Zhang <18255117159@163.com>
Fri, 1 May 2026 16:10:08 +0000 (00:10 +0800)
committerManivannan Sadhasivam <mani@kernel.org>
Fri, 15 May 2026 17:12:59 +0000 (22:42 +0530)
Remove the redundant mode field from struct artpec6_pcie and use the
existing mode field in struct dw_pcie instead.

This avoids duplication and prevents potential inconsistencies between
the two mode fields.

Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260501161010.71688-3-18255117159@163.com
drivers/pci/controller/dwc/pcie-artpec6.c

index 55cb957ae1f3bdda330d5a9ec21ccc48048ae8ef..5cd227dda9a1094347b05c86840da3d79c8a9891 100644 (file)
@@ -34,7 +34,6 @@ struct artpec6_pcie {
        struct regmap           *regmap;        /* DT axis,syscon-pcie */
        void __iomem            *phy_base;      /* DT phy */
        enum artpec_pcie_variants variant;
-       enum dw_pcie_device_mode mode;
 };
 
 struct artpec_pcie_of_data {
@@ -100,7 +99,7 @@ static u64 artpec6_pcie_cpu_addr_fixup(struct dw_pcie *pci, u64 cpu_addr)
        struct dw_pcie_rp *pp = &pci->pp;
        struct dw_pcie_ep *ep = &pci->ep;
 
-       switch (artpec6_pcie->mode) {
+       switch (artpec6_pcie->pci->mode) {
        case DW_PCIE_RC_TYPE:
                return cpu_addr - pp->cfg0_base;
        case DW_PCIE_EP_TYPE:
@@ -413,7 +412,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
 
        artpec6_pcie->pci = pci;
        artpec6_pcie->variant = variant;
-       artpec6_pcie->mode = mode;
+       artpec6_pcie->pci->mode = mode;
 
        artpec6_pcie->phy_base =
                devm_platform_ioremap_resource_byname(pdev, "phy");
@@ -428,7 +427,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, artpec6_pcie);
 
-       switch (artpec6_pcie->mode) {
+       switch (artpec6_pcie->pci->mode) {
        case DW_PCIE_RC_TYPE:
                if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_HOST))
                        return -ENODEV;
@@ -464,7 +463,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
 
                break;
        default:
-               dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode);
+               dev_err(dev, "INVALID device type %d\n", artpec6_pcie->pci->mode);
        }
 
        return 0;