Skip to content

Commit

Permalink
phy: rockchip: usbdp: fix uninitialized variable
Browse files Browse the repository at this point in the history
The ret variable may not be initialized in rk_udphy_usb3_phy_init(), if
the PHY is not using USB3 mode.

Since the DisplayPort part is handled separately and the PHY does not
support USB2 (which is routed to another PHY on Rockchip RK3588), the
right exit code for this case is 0. Thus let's initialize the variable
accordingly.

Fixes: 2f70bbd ("phy: rockchip: add usbdp combo phy driver")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Sebastian Reichel <[email protected]>
Reviewed-by: Muhammad Usama Anjum <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
sre authored and vinodkoul committed Apr 17, 2024
1 parent a1fe1ec commit c9342d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/phy/rockchip/phy-rockchip-usbdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ static const struct phy_ops rk_udphy_dp_phy_ops = {
static int rk_udphy_usb3_phy_init(struct phy *phy)
{
struct rk_udphy *udphy = phy_get_drvdata(phy);
int ret;
int ret = 0;

mutex_lock(&udphy->mutex);
/* DP only or high-speed, disable U3 port */
Expand Down

0 comments on commit c9342d1

Please sign in to comment.