]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: keembay: Use common mode field in struct dw_pcie
authorHans Zhang <18255117159@163.com>
Fri, 1 May 2026 16:10:10 +0000 (00:10 +0800)
committerManivannan Sadhasivam <mani@kernel.org>
Fri, 15 May 2026 17:13:08 +0000 (22:43 +0530)
Remove the redundant mode field from struct keembay_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-5-18255117159@163.com
drivers/pci/controller/dwc/pcie-keembay.c

index 7cf2c312ecec20df49df2a8bcb2be81f630cc39b..2459c4d66b889bac1cbbb8def423addb7a1ed876 100644 (file)
@@ -58,7 +58,6 @@
 struct keembay_pcie {
        struct dw_pcie          pci;
        void __iomem            *apb_base;
-       enum dw_pcie_device_mode mode;
 
        struct clk              *clk_master;
        struct clk              *clk_aux;
@@ -117,7 +116,7 @@ static int keembay_pcie_start_link(struct dw_pcie *pci)
        u32 val;
        int ret;
 
-       if (pcie->mode == DW_PCIE_EP_TYPE)
+       if (pcie->pci.mode == DW_PCIE_EP_TYPE)
                return 0;
 
        keembay_pcie_ltssm_set(pcie, false);
@@ -409,7 +408,7 @@ static int keembay_pcie_probe(struct platform_device *pdev)
        pci->dev = dev;
        pci->ops = &keembay_pcie_ops;
 
-       pcie->mode = mode;
+       pcie->pci.mode = mode;
 
        pcie->apb_base = devm_platform_ioremap_resource_byname(pdev, "apb");
        if (IS_ERR(pcie->apb_base))
@@ -417,7 +416,7 @@ static int keembay_pcie_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, pcie);
 
-       switch (pcie->mode) {
+       switch (pcie->pci.mode) {
        case DW_PCIE_RC_TYPE:
                if (!IS_ENABLED(CONFIG_PCIE_KEEMBAY_HOST))
                        return -ENODEV;
@@ -443,7 +442,7 @@ static int keembay_pcie_probe(struct platform_device *pdev)
 
                break;
        default:
-               dev_err(dev, "Invalid device type %d\n", pcie->mode);
+               dev_err(dev, "Invalid device type %d\n", pcie->pci.mode);
                return -ENODEV;
        }