Skip to content

Commit 1b0face

Browse files
Siddharth-Vadapalli-at-TIsmb49
authored andcommitted
phy: ti: j721e-wiz: Fix unreachable code in wiz_mode_select()
BugLink: https://bugs.launchpad.net/bugs/2025067 [ 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 <s-vadapalli@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Link: https://lore.kernel.org/r/20230403094552.929108-1-s-vadapalli@ti.com Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 9cb0735 commit 1b0face

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

drivers/phy/ti/phy-j721e-wiz.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,18 +430,17 @@ static int wiz_mode_select(struct wiz *wiz)
430430
int i;
431431

432432
for (i = 0; i < num_lanes; i++) {
433-
if (wiz->lane_phy_type[i] == PHY_TYPE_DP)
433+
if (wiz->lane_phy_type[i] == PHY_TYPE_DP) {
434434
mode = LANE_MODE_GEN1;
435-
else if (wiz->lane_phy_type[i] == PHY_TYPE_QSGMII)
435+
} else if (wiz->lane_phy_type[i] == PHY_TYPE_QSGMII) {
436436
mode = LANE_MODE_GEN2;
437-
else
438-
continue;
439-
440-
if (wiz->lane_phy_type[i] == PHY_TYPE_USXGMII) {
437+
} else if (wiz->lane_phy_type[i] == PHY_TYPE_USXGMII) {
441438
ret = regmap_field_write(wiz->p0_mac_src_sel[i], 0x3);
442439
ret = regmap_field_write(wiz->p0_rxfclk_sel[i], 0x3);
443440
ret = regmap_field_write(wiz->p0_refclk_sel[i], 0x3);
444441
mode = LANE_MODE_GEN1;
442+
} else {
443+
continue;
445444
}
446445

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

0 commit comments

Comments
 (0)