]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: brcmstb: Do not assume that register field starts at LSB
authorJim Quinlan <james.quinlan@broadcom.com>
Fri, 14 Feb 2025 17:39:31 +0000 (12:39 -0500)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Tue, 4 Mar 2025 15:58:17 +0000 (15:58 +0000)
commitb5e441793e07873397622ca917517a43aa84fe44
tree53b3beeecaeb2cb9fe5aed2edfa4a1a0936430d2
parent0c97321e11e0e9e18546f828492758f6aaecec59
PCI: brcmstb: Do not assume that register field starts at LSB

When setting the LNKCAP and LNKCTL2 register fields, it was assumed
that the field started at the LSB of the register.

Although the masks do indeed start at the LSB, and this will probably
not change, it is prudent to use a method that makes no assumption
about the mask's placement in the register.

Thus, use the u{16,32}p_replace_bits() helpers since they are already
wildly used in this driver.

Signed-off-by: Jim Quinlan <james.quinlan@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20250214173944.47506-4-james.quinlan@broadcom.com
[kwilczynski: commit log]
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
drivers/pci/controller/pcie-brcmstb.c