diff options
| author | Hans Zhang <18255117159@163.com> | 2026-03-13 19:55:20 +0300 |
|---|---|---|
| committer | Manivannan Sadhasivam <mani@kernel.org> | 2026-03-26 21:31:31 +0300 |
| commit | 126d04398cd4e29743828c38c21f39f46fc2e004 (patch) | |
| tree | 05bdad4244620a932de3270751cc32a8a2a0b937 | |
| parent | 0f34f647f19465b475b13e889dcb33526e166d24 (diff) | |
| download | linux-126d04398cd4e29743828c38c21f39f46fc2e004.tar.xz | |
PCI: j721e: Validate max-link-speed from DT
Use the new pcie_get_link_speed() helper to validate the value read from
the "max-link-speed" DT property. If the value is missing or invalid,
fall back to Gen2 (speed = 2). This prepares for the removal of the
range check in of_pci_get_max_link_speed().
Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260313165522.123518-4-18255117159@163.com
| -rw-r--r-- | drivers/pci/controller/cadence/pci-j721e.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index 6f2501479c70..bfdfe98d5aba 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -202,7 +202,8 @@ static int j721e_pcie_set_link_speed(struct j721e_pcie *pcie, int ret; link_speed = of_pci_get_max_link_speed(np); - if (link_speed < 2) + if ((link_speed < 2) || + (pcie_get_link_speed(link_speed) == PCI_SPEED_UNKNOWN)) link_speed = 2; val = link_speed - 1; |
