]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
phy: usb: update Broadcom driver table to use designated initializers
authorSam Edwards <cfsworks@gmail.com>
Fri, 4 Oct 2024 03:41:31 +0000 (20:41 -0700)
committerVinod Koul <vkoul@kernel.org>
Mon, 7 Oct 2024 06:15:34 +0000 (11:45 +0530)
commitd3712b35f3c694cb932f87194caafc714109ea08
treee3bc52913fc5f5a7bd2987b8fa2595a31f6d0be3
parentcb4c7df596a9048a6025e96e62fe698f15ec1992
phy: usb: update Broadcom driver table to use designated initializers

The Broadcom USB PHY driver contains a lookup table
(`reg_bits_map_tables`) to resolve register bitmaps unique to certain
versions of the USB PHY as found in various Broadcom chip families.
Historically, this table was just kept carefully in sync with the
"selector" enum every time the latter changed to ensure consistency.
However, a recent commit [1] introduced two new enumerators but did not
adjust the array for BCM4908, thus breaking the xHCI controller (and
boot process) on this platform and revealing the fragility of this
approach.

Since these arrays are a little sparse (many elements are zero) and the
position of the array elements is significant only insofar as they agree
with the enumerators, designated initializers are a better fit than
positional initializers here. Convert this table accordingly.

[1] 4536fe9640b6 ("phy: usb: suppress OC condition for 7439b2")

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Justin Chen <justin.chen@broadcom.com>
Link: https://lore.kernel.org/r/20241004034131.1363813-3-CFSworks@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/broadcom/phy-brcm-usb-init.c