Skip to content

Commit 967969c

Browse files
Ma Kevinodkoul
authored andcommitted
phy: cadence-torrent: Check return value on register read
cdns_torrent_dp_set_power_state() does not consider that ret might be overwritten. Add return value check of regmap_read_poll_timeout() after register read in cdns_torrent_dp_set_power_state(). Fixes: 5b16a79 ("phy: cadence-torrent: Reorder few functions to remove function declarations") Signed-off-by: Ma Ke <[email protected]> Reviewed-by: Roger Quadros <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent db4eb41 commit 967969c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/phy/cadence/phy-cadence-torrent.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,9 @@ static int cdns_torrent_dp_set_power_state(struct cdns_torrent_phy *cdns_phy,
11571157
ret = regmap_read_poll_timeout(regmap, PHY_PMA_XCVR_POWER_STATE_ACK,
11581158
read_val, (read_val & mask) == value, 0,
11591159
POLL_TIMEOUT_US);
1160+
if (ret)
1161+
return ret;
1162+
11601163
cdns_torrent_dp_write(regmap, PHY_PMA_XCVR_POWER_STATE_REQ, 0x00000000);
11611164
ndelay(100);
11621165

0 commit comments

Comments
 (0)