[PATCH 0/3] PCIe: Refactor link speed configuration with unified macro

From: Hans Zhang
Date: Mon May 19 2025 - 12:34:05 EST


This series standardizes PCIe link speed handling across multiple drivers
by introducing a common conversion macro PCIE_SPEED2LNKCTL2_TLS_ENC. The
changes eliminate redundant speed-to-register mappings and simplify code
maintenance:

The refactoring improves code consistency and reduces conditional
branching, while maintaining full backward compatibility with existing
speed settings.

Hans Zhang (3):
PCI: Add PCIE_SPEED2LNKCTL2_TLS_ENC conversion macro
PCI: dwc: Simplify link speed configuration with macro
PCI/bwctrl: Replace legacy speed conversion with shared macro

drivers/pci/controller/dwc/pcie-designware.c | 18 +++---------------
drivers/pci/pci.h | 9 +++++++++
drivers/pci/pcie/bwctrl.c | 19 +------------------
3 files changed, 13 insertions(+), 33 deletions(-)


base-commit: fee3e843b309444f48157e2188efa6818bae85cf
--
2.25.1