[PATCH 0/4] PCI: dwc: designware-plat: Use common mode field in struct dw_pcie
From: Hans Zhang
Date: Fri May 01 2026 - 12:11:28 EST
Several DesignWare PCIe controller drivers (dra7xx, artpec6,
designware-plat, and keembay) duplicated the device mode field
in their private structures, while struct dw_pcie already contains
this field. This led to:
1. Data redundancy and potential inconsistencies
2. Increased maintenance complexity
3. Error-prone device type checks
This series fixes these issues by:
- Removing redundant mode fields from all four drivers
- Standardizing on dw_pcie->mode for device type detection
- Simplifying conditional logic in probe/suspend/resume paths
- Ensuring consistent error reporting
The changes improve code maintainability and eliminate class of bugs
related to mode synchronization.
Hans Zhang (4):
PCI: dra7xx: Use common mode field in struct dw_pcie
PCI: artpec6: Use common mode field in struct dw_pcie
PCI: dwc: Use common mode field in struct dw_pcie
PCI: keembay: Use common mode field in struct dw_pcie
drivers/pci/controller/dwc/pci-dra7xx.c | 11 +++++------
drivers/pci/controller/dwc/pcie-artpec6.c | 9 ++++-----
drivers/pci/controller/dwc/pcie-designware-plat.c | 7 +++----
drivers/pci/controller/dwc/pcie-keembay.c | 9 ++++-----
4 files changed, 16 insertions(+), 20 deletions(-)
base-commit: e75a43c7cec459a07d91ed17de4de13ede2b7758
--
2.34.1