Skip to content

Commit

Permalink
phy: ti: j721e-wiz: Fix unreachable code in wiz_mode_select()
Browse files Browse the repository at this point in the history
[ Upstream commit 57c0e13 ]

In the wiz_mode_select() function, the configuration performed for
PHY_TYPE_USXGMII is unreachable. Fix it.

Fixes: b64a85f ("phy: ti: phy-j721e-wiz.c: Add usxgmii support in wiz driver")
Signed-off-by: Siddharth Vadapalli <[email protected]>
Reviewed-by: Roger Quadros <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Siddharth-Vadapalli-at-TI authored and gregkh committed May 11, 2023
1 parent 9b33e47 commit cfece3b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions drivers/phy/ti/phy-j721e-wiz.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,18 +443,17 @@ static int wiz_mode_select(struct wiz *wiz)
int i;

for (i = 0; i < num_lanes; i++) {
if (wiz->lane_phy_type[i] == PHY_TYPE_DP)
if (wiz->lane_phy_type[i] == PHY_TYPE_DP) {
mode = LANE_MODE_GEN1;
else if (wiz->lane_phy_type[i] == PHY_TYPE_QSGMII)
} else if (wiz->lane_phy_type[i] == PHY_TYPE_QSGMII) {
mode = LANE_MODE_GEN2;
else
continue;

if (wiz->lane_phy_type[i] == PHY_TYPE_USXGMII) {
} else if (wiz->lane_phy_type[i] == PHY_TYPE_USXGMII) {
ret = regmap_field_write(wiz->p0_mac_src_sel[i], 0x3);
ret = regmap_field_write(wiz->p0_rxfclk_sel[i], 0x3);
ret = regmap_field_write(wiz->p0_refclk_sel[i], 0x3);
mode = LANE_MODE_GEN1;
} else {
continue;
}

ret = regmap_field_write(wiz->p_standard_mode[i], mode);
Expand Down

0 comments on commit cfece3b

Please sign in to comment.