PCI: qcom: Use PCIE_SPEED2MBS_ENC() macro for encoding link speed
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Wed, 4 Oct 2023 16:44:28 +0000 (22:14 +0530)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Sat, 14 Oct 2023 19:16:06 +0000 (19:16 +0000)
commit8da2e9af0bb5217361f4ddde0d9b820b45c185e8
treef3e6ed516ba5134490c2004edadb36f9249cd15f
parent0bb80ecc33a8fb5a682236443c1e740d5c917d1d
PCI: qcom: Use PCIE_SPEED2MBS_ENC() macro for encoding link speed

Instead of hardcoding the link speed in MBps, use existing
PCIE_SPEED2MBS_ENC() macro that does the encoding of the link speed for
us. Also, let's Wrap it with QCOM_PCIE_LINK_SPEED_TO_BW() macro to do
the conversion to ICC speed.

This eliminates the need for a switch case in qcom_pcie_icc_update() and
also works for future Gen speeds without any code modifications.

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/linux-pci/20231004164430.39662-1-manivannan.sadhasivam@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
drivers/pci/controller/dwc/pcie-qcom.c