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

index d103ab759c4ee504a9e6154f9d9daa5feb7fc6bf..d02286678a0afda7bebdae9502fe5f8fcd9b7a8a 100644 (file)
@@ -22,7 +22,6 @@
 
 struct dw_plat_pcie {
        struct dw_pcie                  *pci;
-       enum dw_pcie_device_mode        mode;
 };
 
 struct dw_plat_pcie_of_data {
@@ -118,11 +117,11 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
        pci->dev = dev;
 
        dw_plat_pcie->pci = pci;
-       dw_plat_pcie->mode = mode;
+       dw_plat_pcie->pci->mode = mode;
 
        platform_set_drvdata(pdev, dw_plat_pcie);
 
-       switch (dw_plat_pcie->mode) {
+       switch (dw_plat_pcie->pci->mode) {
        case DW_PCIE_RC_TYPE:
                if (!IS_ENABLED(CONFIG_PCIE_DW_PLAT_HOST))
                        return -ENODEV;
@@ -148,7 +147,7 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
 
                break;
        default:
-               dev_err(dev, "INVALID device type %d\n", dw_plat_pcie->mode);
+               dev_err(dev, "INVALID device type %d\n", dw_plat_pcie->pci->mode);
                ret = -EINVAL;
                break;
        }